How to get char which as '\u65e0' in TextBox ?

  • Thread starter Thread starter HuYi
  • Start date Start date
H

HuYi

Hi,everyone,I want to get a string as '\u65e0\u6cd5' in TextBox,but when I
trace the program,I found that TextBox.Text=@"\u65e0\u6cd5",
But I want "\u65e0\u6cd5",not @"\u65e0\u6cd5".
I used TextBox.Text.ToArray(),the result:char[] chars =
{'\','u','6','5'....}.
I need char[] chars = {'\u65e0','\u6cd5'}
How should I do?Thanks.
 
HuYi said:
Hi,everyone,I want to get a string as '\u65e0\u6cd5' in TextBox,but when I
trace the program,I found that TextBox.Text=@"\u65e0\u6cd5",
But I want "\u65e0\u6cd5",not @"\u65e0\u6cd5".
I used TextBox.Text.ToArray(),the result:char[] chars =
{'\','u','6','5'....}.
I need char[] chars = {'\u65e0','\u6cd5'}
How should I do?Thanks.

Just use

textBox.Text = "\u65e0\u6cd5";

What does your code look like now?
 
DanaR said:
The "@" is inserted when displaying the data to the debugger to
signify that the string is a "constant".

No it's not. It's to signify that there's data in there which would
otherwise need escaping. For instance, if it displays

@"hello\there"

then that's a string with the words "hello" and "there" separated by a
backslash.

If it displays
"hello\there"

then that's a string with the words "hello" and "here" separated by a
tab.
 
Back
Top