473,405 Members | 2,282 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,405 software developers and data experts.

strings comparison

Hello

I'm trying to compare two strings:

1. retrieved from custom xmlplaceholder (Microsoft CMS):
zrodlo = fact.Placeholders["kategoria2"] as XmlPlaceholder;

esc_kat2 = Server.HtmlEncode(zrodlo.XmlAsString);

esc_kat2 = esc_kat2.Replace("<","");

esc_kat2 = esc_kat2.Replace(">","");

esc_kat2 = esc_kat2.Replace("/Zones","");

esc_kat2 = esc_kat2.Replace("/Zone","");

esc_kat2 = esc_kat2.Replace("Zones","");

kategoria2 = esc_kat2.Replace("Zone","");
String kategoria2 has my nationals characters translated into unicode and
looks like this:

"orzecznictwo do celów pozarentowych"

2. The second one is retrieved from SQL database:

selectCmd = "select * from urzond_main order by id";

myCommand = new SqlCommand(selectCmd, myConnection);

myConnection.Open();

myReader = myCommand.ExecuteReader();

while (myReader.Read())

{

kategoria1 = myReader.GetSqlString(1).ToString();

}

String kategoria1 has original national characters without being
translated into unicode:

orzecznictwo do celów pozarentowych

I cannot compare these strings 'cos they are different.

What is the best advice? Please give some code portion with an advice.

Best Regards

Darek
Nov 17 '05 #1
1 1232
Darek,

(sent accidently to the emailaddress first)

I don't believe in "best methods" otherwise there was a standard method.

It is your decission how something is the same. If it is needed that:

Walensa has to be the same as Walesa, than it is probably very difficult to do if for that is not somehwere a Polish routine on the InterNet.

However if it has to be Walesa than you can look for this methods.

http://msdn.microsoft.com/library/de...dingtopic1.asp
Here some links to used code pages.

Unicode
http://www.geocities.com/Athens/Acad.../fontset.htm#b

OS systems

http://www.microsoft.com/globaldev/r...ocversion.mspx

I hope this helps a little bit?

Cor
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: William Park | last post by:
How do you compare 2 strings, and determine how much they are "close" to each other? Eg. aqwerty qwertyb are similar to each other, except for first/last char. But, how do I quantify that? ...
6
by: Al Newton | last post by:
I want to use STL's sort algorithm to sort a string vector. Some of the strings are fairly long (300 to 400 chars) and the vector isn't small (5,000 to 10,000 elements). Naturally, sorting time...
5
by: Colin Savage | last post by:
Please could somebody explain what an "atomized string" is? I have been doing loops in the msdn around XmlNameTable and NameTable but neither explain what an atomized string is. The example for one...
6
by: C# Learner | last post by:
I want to compare two strings, in a numeric fashion. e.g.: string a = "10"; string b = "2"; int comparison = String.Compare(a, b); // comparison is now <0, but I want it to be >0 in this...
14
by: Samuel R. Neff | last post by:
Why would you cast two strings to objects to compare them? I saw code in an MS sample on MSDN and don't get it. if ( (object)name == (object)attr.name ) { both "name" and "attr.name" are...
9
by: Steven | last post by:
Hello, I have a question about strcmp(). I have four words, who need to be compared if it were two strings. I tried adding the comparison values like '(strcmp(w1, w2) + strcmp(w3, w4))', where...
14
by: Dennis Benzinger | last post by:
Hi! The following program in an UTF-8 encoded file: # -*- coding: UTF-8 -*- FIELDS = ("Fächer", ) FROZEN_FIELDS = frozenset(FIELDS) FIELDS_SET = set(FIELDS)
5
by: Michael Yanowitz | last post by:
Hello: I have been searching for an easy solution, and hopefully one has already been written, so I don't want to reinvent the wheel: Suppose I have a string of expressions such as: "((($IP =...
95
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ...
2
by: franzdawg3 | last post by:
I find it hard to believe that there is not a native solution to this problem built into VB.NET but based on what I've come up with from MSDN and google if there is one it is not obvious. I have...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.