-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Cast Char to String. #69
Comments
As an implicit conversion? Certainly not, that can lead to unnecessary string allocations. As an explicit conversion? Maybe, but it's not different from calling ToString() and, at least in my experience, rarely necessary. |
In practice, you can do:
rather than :
So I'm not sure that:
would be a worthwhile improvement. However, |
You're not implying those are the same thing. Are you? |
If I've understood string interpolation correctly, then If it were considered desirable to have a shorter way of converting a It also occurred to me that this syntax needn't be limited to converting character expressions to strings - you could convert other types as well - and could be thought of as a shorthand for |
No it isn't. Have a look at this post: Customizing string interpolation in C# 6 |
Include a few more warnings that we have from roslyn
Would it be beneficial to have a
Char
to be cast-able to aString
?You could think of it as a String of one character in length.
The text was updated successfully, but these errors were encountered: