is (StringComparison.)Ordinal the same as InvariantCulture for testing equality?

Posted by Tim Lovell-Smith on Stack Overflow See other posts from Stack Overflow or by Tim Lovell-Smith
Published on 2011-01-12T22:10:49Z Indexed on 2011/01/13 1:53 UTC
Read the original article Hit count: 469

Filed under:
|
|

From what I read so far, it sounds like these StringComparison types are meant to differ in how they do sorting of strings, if so, does that mean that it does'nt matter which StringComparison you use when doing an equality comparison?

string.Equals(a, b, StringComparison....)

Extra credit: does it make a difference to the answer if we compare OrdinalIgnoreCase and InvariantCultureIgnoreCase? What is the answer then?

Please provide supporting argument and/or references.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about string