From my previous question, Converting chinese character to Unicode, I had a good answer but with some code I didn’t understand:
Console.WriteLine("U+{0:x4}", (int)myChar);
Could anyone explain this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
0indicates which positional argument to substitute. Thexdisplays a hexadecimal number, the4has it display four digits.For example, the character ȿ (LATIN SMALL LETTER S WITH SWASH TAIL, codepoint 575) is printed as
U+023Fsince 57510 = 23F16.