Changing the case of characters within a String
System.String class supports a number of methods to convert between uppercase and lowercase characters in a string.
System.String.ToLowerInvariantis used to return a String object converted to lowercase.
System.String.ToUpperInvariantis used to return a String object converted to uppercase.
Note: The reason to use the invariant versions of these methods is to prevent producing unexpected culture-specific letters. This is explained here in detail.
string s = "My String"; s = s.ToLowerInvariant(); // "my string" s = s.ToUpperInvariant(); // "MY STRING"