Thursday 31 January 2013

How to I put a Unicode Character in my C# String?

Answer: Use a Unicode character ESCAPE SEQUENCE - representing a SINGLE Unicode character. C# uses a 16 bit character encoding for Unicode code points. BACKSLASH U.

Unicode codes are all here. To use in C#, lower-case the U and remove the + sign.

Example:

public static string sigma = '\u03C3'.ToString();

Maths requires use of "Greek and Coptic" character subset of Unicode, Coptic being an adapted Greek alphabet that was being used in Egypt.

No comments: