473,387 Members | 1,790 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,387 software developers and data experts.

Compare unicode string

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
3 3447
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

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

Similar topics

2
by: Lian | last post by:
Hi all, I am confused by the rule of comparing two unicode string using function "strcmp". For exmaple, using "strcmp" to compare two Chinese uincode string, depending on what rule can "PHP"...
8
by: Bill Eldridge | last post by:
I'm trying to grab a document off the Web and toss it into a MySQL database, but I keep running into the various encoding problems with Unicode (that aren't a problem for me with GB2312, BIG 5,...
1
by: Laurent Liegeois | last post by:
Hi, I have a funny Error in our sql server 7 & 2000. When I compare two string in Unicode format. I receive that it is the same when I add new nchar. I don’t understand why? Could you...
4
by: Matt | last post by:
I posted this problem before but no reply. Now I repost again. I want to compare the address number in javascript, and the address number is alphanumeric. I have a text box and the user needs to...
2
by: Neil Schemenauer | last post by:
python-dev@python.org.] The PEP has been rewritten based on a suggestion by Guido to change str() rather than adding a new built-in function. Based on my testing, I believe the idea is...
19
by: David zhu | last post by:
I've got different result when comparing two strings using "==" and string.Compare(). The two strings seems to have same value "1202002" in the quick watch, and both have the same length 7 which I...
3
by: Benny Ng | last post by:
Dear all, The following is the source. The password is encrypted and saved into the Binary in SQL2K. Now I want to create a new page to compare the existed password and the password that in the...
11
by: Marshall Dudley | last post by:
I am comparing two numbers, and the comparison gives absolutely bizzare results. I am comparing 5 with a number that is entered in a form. Then if the number entered is 5, or between 50 and 95, it...
5
by: Asterix | last post by:
how could I test that those 2 strings are the same: 'séd' (repr is 's\\xc3\\xa9d') u'séd' (repr is u's\\xe9d')
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.