I am trying to generate an array of chars using the ‘\u…’ syntax. The purpose is to let the user select which characters they want to filter out of some string. This is what I have so far”
char[] uChars = new char[1000];
uChars[0] = '\u00e4';
Debug.WriteLine(uChars[0] + " " + Convert.ToUInt16(uChars[0]).ToString("X4"));
for (UInt16 i = 0; i <= 1000; i++) {
Debug.WriteLine(i.ToString() + " " + i.ToString("X4"));
Debug.WriteLine(@"'\u" + i.ToString("X4") + @"'");
// the following line fails syntax but that is what I want to do.
uChars[0] = @"'\u" + i.ToString("X4") + @"'";
}
Methinks you want to be using Convert.ToChar.