Contains insensitive to culture:
This method performs an ordinal (case-sensitive and culture-insensitive) comparison.
IndexOf culture sensitive:
This method searches for words (case-sensitive and culture-sensitive) using the current culture.
This is the difference. If you use
int index = text.IndexOf(word, StringComparison.Ordinal);
then you get index 0 instead of -1 (so it matches Contains ).
No Culture Sensitive Overload Contains ; I donโt understand if IndexOf can be reliably used for this, but the CompareInfo class provides a few more options. (I really don't know much about the details of cultural comparisons, especially with the text RTL. I just know it's complicated!)
source share