473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
3 2057
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Trep | last post by:
Hi there! I've been having a lot of difficult trying to figure out a way to convert a terminated char array to a system::string for use in Visual C++ .NET 2003. This is necessary because I...
5
by: Ron | last post by:
Greetings, I am writing text to a multi line textbox on a timer as follows: txt1.AppendText(@"/* " + DateTime.Now.ToString() + "\n"); Here is what gets displayed /* 1/1/2004 11:12:11 AM|
3
by: Dakkar | last post by:
I want to make a password system like this every character will have an equal character for example a will be equal to g and b will be equal to f when person writes ab it will change automaticly...
1
by: VB Programmer | last post by:
What is the max # of char a textbox can handle? Thanks!
6
by: CalSun | last post by:
Hi all, I try to save a multiline textbox into an sql field (nvarchar(1024)). As I read it out and display, the text drops all the linefeed char. Is there a way to cure this? Thank you all for...
7
by: scottiedog | last post by:
Hi How can I send a char to Textbox so that KeyPress event is called? I have a button and with a click I would like to send a char, e.g. "C", to the Textbox. But Textbox1_KeyPress is not catching...
2
by: Marc Robitaille | last post by:
Hello, I think it is a easy question but I don't have any clue how to do it...Is it possible to replace the char that a user type in a textbox with an other one in the OnKeyPress methode? My...
4
by: Matt Fondoble | last post by:
I have a form with multiple textboxes, checkboxes and comboboxes bound to a dataset in VB 2003. I was forced to change the database structure of a field from bigint to char. After changing the...
1
by: vcbytes | last post by:
I am having a problem with the following code: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { String^ texts = textBox1->Text; char *text =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.