presumeably you want it to be able to compare them where there it would treat the á as an a and the í as an i? if so then when you bring it in you could store the sent string as a value then run it through a method where it replaces the special characters with what you want it to be treated as e.g turn all á into a, run the compare script on the filtered and changed string then return the original string before it was edited, the user never needs to know it was changed to represent a-z characters and it would never be saved or displayed back as those! hope this is a viable solution for you!
-
str.Replace('á','a');
-
//where str is the name of the string
-
for example the following code takes whatever is in a textbox, turns all á into a then pastes it back to the textbox,
- textBox1.Text = (textBox1.Text.Replace('á', 'a'));
but you would want to do something like this i guess
-
buttonclick event
-
{
-
string original1 = textbox1.text;
-
string original2 = textbox2.text;
-
string replaced1 = original1.Replace('á', 'a'));
-
string replaced2 = original2.Replace('á', 'a'));
-
int comparer = Compare(replaced1,replaced2);
-
if (comparer==1)
-
{
-
messagebox.show(original1);
-
}
-
else if (comparer == -1)
-
{
-
messagebox.show(original2);
-
}
-
else
-
{
-
messagebox.show("Both are equal");
-
}
-
}
-
public int Compare (string a,string b)
-
{
-
int result = replaced1.CompareTo(replaced2);
-
//this is 0 if they are the same
-
//or it is -1 if replaced 1 is 'smaller'
-
//or is 1 is replaced1 is 'bigger'
-
return result;
-
}
-
-
this isnt identical to what you asked for but should explain it well enough for you to use it as you need it!