How to match file names in .NET?
I read which InvariantCultureis preferred, but here is my problem ...
A case-insensitive comparison of the Turkish file name with the classic question "I" and "i", where "İSMİNİZ.GIF" is equivalent to "isminiz.gif". The "I" in "isminiz" matches the "İ" in "İSMİNİZ", but the "i" in the "gif" is compared to the "I" in the "GIF".
None of the String.Equals methods work. The only combination I could find is
String.Compare("İSMİNİZ.GIF", "isminiz.gif",
System.Globalization.CultureInfo.InvariantCulture,
System.Globalization.CompareOptions.IgnoreCase |
System.Globalization.CompareOptions.IgnoreNonSpace)
Is this right or is something better?
source
share