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


The C# string ToLower() method is used to return the string with all characters of the specified string in lowercase. Any symbol, space, special character or number in the string is ignored while applying this method. Only Alphabets are converted.

Note: This method can be overloaded by passing different type of arguments to it.

Syntax

public string ToLower();
public string ToLower (System.Globalization.CultureInfo culture);

Parameters

culture Specify an object that supplies culture-specific casing rules.

Return Value

Returns the string with all characters of the specified string in lowercase.

Exception

throws ArgumentNullException, if the culture is null.

Example:

In the below example, ToLower() method to used to return a string containing all characters of the specified string MyStr in lowercase.

using System;

class MyProgram {
  static void Main(string[] args) {
    string MyStr = "HeLLo John!";
    string NewStr = MyStr.ToLower();

    Console.WriteLine(NewStr);  
  }
}

The output of the above code will be:

hello john!

Example:

In the below example, ToLower() method to used to return a string containing all characters of the specified string MyStr in lowercase using the English-United States and Turkish-Turkey cultures.

using System;
using System.Globalization;
 
class MyProgram {
  static void Main(string[] args) {
    string MyStr = "HeLLo John!";
    string NewStr1 = MyStr.ToLower(new CultureInfo("en-US", false));
    string NewStr2 = MyStr.ToLower(new CultureInfo("tr-TR", false));

    Console.WriteLine(NewStr1); 
    Console.WriteLine(NewStr2);  
  }
}

The output of the above code will be:

hello john!

hello john!

❮ C# String Methods