Facebook Page Twitter Page LinkedIn Page
× C# Tutorial C# Advanced C# Resources


The C# string ToLowerInvariant() method is used to return 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 below example, ToLowerInvariant() method to used to return 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