Pregunta

I am going to write a simple console app in C# that replaces all Latin based characters with their respectively defined replacedment (like Å (ALT+143) becomes AA).

I was wondering how it is viewed in C#. Would it be seen as the string "\uC5" or "\u00C5" or "Å" or something else?

¿Fue útil?

Solución

It is (almost!) always viewed as a character literal in format "\u00C5".

See this article on Char: http://msdn.microsoft.com/en-us/library/x9h8tsay(v=vs.110).aspx

and this article specifically on character literals which, while outdated, still applies in the latest version of .NET

http://msdn.microsoft.com/en-us/library/aa664669(v=vs.71).aspx

Otros consejos

C# strings are Unicode, so it will be shown as is

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top