Java toLowerCase() 方法

约 361 字 更新于 2026-11-18 5iyo.com

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.RUNOOB.COM");



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

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

    }

}

以上程序执行结果为:

返回值 :www.runoob.com