You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently have a code base where I pass around a string as a ReadOnlySpan<char> and I'd like to call ToString() at the latest moment possible. However, I'd also like to guard against NullOrEmpty or NullOrWhiteSpace. Perhaps even against a pattern but I suppose that's impossible with regex and span.
The text was updated successfully, but these errors were encountered:
KonH
added a commit
to KonH/GuardClauses
that referenced
this issue
Oct 9, 2022
@Marvin-Brouwer please take a look at the pull request above - I tried to implement what you looking for.
I'm not happy with semantics - it doesn't make sense to actually check span against null.
But it is much more friendly for an end user to have same name overloads and not think about the underlying type.
I currently have a code base where I pass around a string as a
ReadOnlySpan<char>
and I'd like to callToString()
at the latest moment possible. However, I'd also like to guard againstNullOrEmpty
orNullOrWhiteSpace
. Perhaps even against a pattern but I suppose that's impossible with regex and span.The text was updated successfully, but these errors were encountered: