Char.ToLowerInvariant(Char) Method in C#


The Char.ToLowerInvariant() method in C# is used to convert the value of a Unicode character to its lowercase equivalent using the casing rules of the invariant culture.

Output

Following is the syntax −

public static char ToLowerInvariant (char ch);

Above, the parameter ch is the Unicode character to convert.

Example

Let us now see an example to implement the Char.ToLowerInvariant() method −

using System;
public class Demo {
   public static void Main(){
      char ch = 'D';
      char res = Char.ToLowerInvariant(ch);
      Console.WriteLine("Value = "+ch);
      Console.WriteLine("Lowercase Equivalent = "+res);
   }
}

Output

This will produce the following output −

Value = D
Lowercase Equivalent = d

Example

Let us now see another example −

using System;
public class Demo {
   public static void Main(){
      char ch = 'p';
      char res = Char.ToLowerInvariant(ch);
      Console.WriteLine("Value = "+ch);
      Console.WriteLine("Lowercase Equivalent = "+res);
   }
}

Output

This will produce the following output −

Value = p
Lowercase Equivalent = p
raja
Published on 06-Nov-2019 08:05:34
Advertisements