Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Support for ReadOnlySpan<char> #220

Open
Marvin-Brouwer opened this issue Aug 10, 2022 · 2 comments
Open

Feature request: Support for ReadOnlySpan<char> #220

Marvin-Brouwer opened this issue Aug 10, 2022 · 2 comments

Comments

@Marvin-Brouwer
Copy link
Contributor

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.

@KonH
Copy link
Contributor

KonH commented 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.

@Marvin-Brouwer
Copy link
Contributor Author

@KonH I made a review on your changes.
I have some suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants