Export (0) Print
Expand All
Expand Minimize

java.lang.String.toLowerCase()

Visual Studio 2005

Converts all the characters in a String to lowercase.


public String toLowerCase()

A String object containing all the characters of the current String converted to lowercase.

// string_tolowercase1.jsl

public class Program
{
    public static void main(String[] args)
    {
        String str = "ThIs Is HaRd To ReAd.";

        // Convert the above string to all lowercase.
        String lowerStr = str.toLowerCase();

        // Display the two strings for comparison.
        System.out.println("old = " + str);
        System.out.println("lowercase = " + lowerStr);
    }
}

/*
Output:
old = ThIs Is HaRd To ReAd.
lowercase = this is hard to read.
*/

Community Additions

ADD
Show:
© 2014 Microsoft