String.ToLower Method

July 28, 2014

Returns a copy of this string converted to lowercase, using the casing rules of the current culture.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public string ToLower()

Return Value

Type: System.String
The lowercase equivalent of the current string.

The String.ToLower() method converts the current string instance to lowercase using the casing rules of the current culture.

NoteNote:

This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are lowercased.

The following code example converts several mixed case strings to lowercase.


using System;

public class Example
{
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
   {

      string[] info = { "Name", "Title", "Age", "Location", "Gender" };

      outputBlock.Text += "The initial values in the array are:" + "\n";
      foreach (string s in info)
         outputBlock.Text += s + "\n";

      outputBlock.Text += String.Format("{0}The lowercase of these values is:", "\n") + "\n";

      foreach (string s in info)
         outputBlock.Text += s.ToLower() + "\n";

      outputBlock.Text += String.Format("{0}The uppercase of these values is:", "\n") + "\n";

      foreach (string s in info)
         outputBlock.Text += s.ToUpper() + "\n";
   }
}


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft