Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Java toLowerCase() Method

Java toLowerCase() Method

Java String ClassJava String class


The toLowerCase() method converts the string to lowercase.

Syntax


public String toLowerCase()

或

public String toLowerCase(Locale locale)

Parameters

Return Value

The string converted to lowercase.

Example


public class Test {
    public static void main(String args[]) {
        String Str = new String("WWW.RUNOOB.COM");

        System.out.print("返回值 :" );
        System.out.println( Str.toLowerCase() );
    }
}

The execution result of the above program is:

返回值 :www.runoob.com

Java String ClassJava String class