我正在尝试使用 '\u...' 语法生成一个字符数组。目的是让用户选择他们想要从某个字符串中过滤掉哪些字符。这就是我目前所拥有的”
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") + @"'";
}