I want to know that Filename1, provided by the user is the same as stored in DB (Filename2).
I was about to use
string.Equals(Filename1, Filename2, StringComparison.CurrentCultureIgnoreCase)
but then I doubted whether I should use StringComparison.InvariantCultureIgnoreCase.
Obviously, I need to do this the same way OS does, or use appropriate API.
In some cultures, AFAIK, characters (e.g. vocals) may change if the next one is Capitalized.
As I primarily target English-speaking market, I’d like my software to work well throughout the world.
To quote Michael Kaplan:
In other words, use
StringComparison.OrdinalIgnoreCaseas the argument tostring.Equalsto mimic the Windows file system.