C# Tutorial C# Advanced C# References

C# String - ToLowerInvariant() Method



The C# ToLowerInvariant() method returns the string with all characters of the specified string in lowercase using the casing rules of the invariant culture. Any symbol, space, special character or number in the string is ignored while applying this method. Only Alphabets are converted.

Syntax

public string ToLowerInvariant();

Parameters

No parameter is required.

Return Value

Returns the string with all characters of the specified string in lowercase using the casing rules of the invariant culture.

Exception

NA.

Example:

In the example below, ToLowerInvariant() method returns a string containing all characters of the specified string MyStr in lowercase using the casing rules of the invariant culture.

using System;

class MyProgram {
  static void Main(string[] args) {
    string[] MyStr = {"Hello", "Здравейте", "Szia", 
                   "Halló", "ਸਤ ਸ੍ਰੀ ਅਕਾਲ", "नमस्कार"};
    
    foreach (string str in MyStr)
      Console.WriteLine(str.ToLowerInvariant()); 
  }
}

The output of the above code will be:

hello
здравейте
szia
halló
ਸਤ ਸ੍ਰੀ ਅਕਾਲ
नमस्कार

❮ C# String Methods