6

Concretely what is the difference between

I feel like that the second one offers more options (comparison using any culture instead of only the current one or invariant one, ignore special characters, ignore the width of katakanas (!!) etc...) than the first one. Both have been introduced it in .NET 2.0 so I guess it can't be a question of backward compatibility.

So what's the difference and when should I use the first one and when should I use the second one?

I had a look at this post and this article, but I think they're dealing with a slightly different matters.

Community
  • 1
  • 1
Guillaume
  • 1,782
  • 1
  • 25
  • 42

1 Answers1

3

Your answer is in the remarks for the second overload.

http://msdn.microsoft.com/en-us/library/cc190529.aspx

"The comparison uses the culture parameter to obtain culture-specific information, such as casing rules and the alphabetical order of individual characters. For example, a particular culture could specify that certain combinations of characters be treated as a single character, that uppercase and lowercase characters be compared in a particular way, or that the sort order of a character depends on the characters that precede or follow it."

The other overload just uses the default culture.

Thinking Sites
  • 3,494
  • 17
  • 30