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

Compare unicode string

P: n/a
Hi, i write a application to search in a tree. each treenode is a unicode
text.
How to compare two unicode string to find extract node i want ?

Regards
Minh
Sep 30 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
All strings in .Net are Unicode strings. Everything is UTF-16 encoded.

Just use the standard compare algorithms (such as "="), and you'll be fine.

All you need is:
if (node1.text == "mytext")
--
Chris Mullins, MCSD.NET, MCPD:Enterprise
www.coversant.net/blogs/cmullins

"Le Minh" <ha*******@hotmail.comwrote in message
news:eC**************@TK2MSFTNGP04.phx.gbl...
Hi, i write a application to search in a tree. each treenode is a unicode
text.
How to compare two unicode string to find extract node i want ?

Regards
Minh


Sep 30 '06 #2

P: n/a

I fetch some text from web. render text on a browser is good. But when i see
this text by quick watch, the character is unreadable. For that, when i
compare it with a unicode string, is not match
Sep 30 '06 #3

P: n/a
Le Minh <ha*******@hotmail.comwrote:
I fetch some text from web. render text on a browser is good. But when i see
this text by quick watch, the character is unreadable. For that, when i
compare it with a unicode string, is not match
That suggests you've got an encoding issue somewhere. See
http://www.pobox.com/~skeet/csharp/d...ngunicode.html for advice.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Sep 30 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.