Java String to小写字母示例。
String类的 toLowerCase()方法有两个变体。第一个变体使用给定Locale的规则将此String中的所有字符转换为小写。这等效于调用toLowerCase(Locale.getDefault())。
第二个变体采用语言环境作为参数,以转换为小写形式。
示例
import java.io.*;
public class Test {
public static void main(String args[]) {
String Str = new String("Welcome to Nhooo.com");
System.out.print("返回值:");
System.out.println(Str.toLowerCase());
}
}输出结果
返回值:welcome to nhooo.com