Duration (Pacific Standard Time):
To (Pacific Standard Time):
  • None
User Action:
  • None

String.ToLower Method ()


Returns a copy of this string converted to lowercase.

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

Public Function ToLower As String

Return Value

Type: System.String

A string in lowercase.

This method takes into account the casing rules of the current culture.

System_CAPS_note Note

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 converted to lowercase.

The casing operation that results from calling the ToLower() method takes the casing conventions of the current culture into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the ToLowerInvariant or ToUpperInvariant methods. This produces the same result in every culture (unlike the ToLower() method) and performs more efficiently.

Notes to Callers:

As explained in Best Practices for Using Strings in the .NET Framework, we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a character to lowercase by using the casing conventions of the current culture, call theToLower(CultureInfo) method overload with a value of CultureInfo.CurrentCulture for its culture parameter.

The following example converts several mixed case strings to lowercase.

Imports System

Public Class ToLowerTest

    Public Shared Sub Main()
        Dim info As String() = {"Name", "Title", "Age", "Location", "Gender"}

        Console.WriteLine("The initial values in the array are:")

        Dim s As String
        For Each s In info

        Console.WriteLine("{0}The lowercase of these values is:", Environment.NewLine)

        For Each s In info

        Console.WriteLine("{0}The uppercase of these values is:", Environment.NewLine)

        For Each s In  info
    End Sub 
End Class 
' The example displays the following output:
'       The initial values in the array are:
'       Name
'       Title
'       Age
'       Location
'       Gender
'       The lowercase of these values is:
'       name
'       title
'       age
'       location
'       gender
'       The uppercase of these values is:
'       NAME
'       TITLE
'       AGE
'       LOCATION
'       GENDER
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top