By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,264 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,264 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Simply use three backslashes:

char[] chars = {"\\\u65e0","\\\u6cd5"}

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
"HuYi" <hu*******@doit.net.cn> schrieb im Newsbeitrag
news:eu**************@TK2MSFTNGP12.phx.gbl...
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.

Nov 16 '05 #2

P: n/a
HuYi <hu*******@doit.net.cn> wrote:
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?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #3

P: n/a
DanaR <Da***@discussions.microsoft.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.