Вопрос

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?

Это было полезно?

Решение

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

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top