跳到主要内容

Java toLowerCase() 方法


toLowerCase() 方法将字符串转换为小写。

语法

public String toLowerCase()







public String toLowerCase(Locale locale)

参数

返回值

转换为小写的字符串。

实例

public class Test {

public static void main(String args[]) {

    String Str = new String("WWW.LECTCODE.COM");



System.out.print("返回值 :" );

System.out.println( Str.toLowerCase() );

    }

}

以上程序执行结果为:

返回值 :www.lectcode.com