SOLVED:
I used the following code:
var compareinfo = CultureInfo.CurrentCulture.CompareInfo;
var index = compareinfo.IndexOf(strA, strB, CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase);
return index > -1;
Possible Duplicate:
Ignoring accented letters in string comparison
I have a public Kiosk application where users use it to search for a place of interest. Say I have a shop name with the Café word. The kiosk only allows input of English alphabets through an on-screen keyboard. The problem is when I type in Cafe(without the accented é) the search is not valid because the user could not input the character é. I want the application to allow the normal e to be searchable to all accented e and likewise for all other respective characters. How can i do that?
EDIT: the shop name is "Bruce Café" and i search for "cafe" and it should show in my search results.
using
string.Compare("Bruce Café", "cafe", CultureInfo.CurrentCulture, CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace)
returns -1
and
string.Compare("Ben-Gurion University (BGU)", "cafe", CultureInfo.CurrentCulture, CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace)
also returns -1
which i don't know why is it so...