如果指定Locale则根据Locale将此String中的所有字符转换为小写,否则调用toLowerCase(Locale.getDefault())默认方法。

String toLowerCase - 语法

public String toLowerCase(Locale locale)

String toLowerCase - 返回值

  • 它返回转换为小写字母的字符串。

String toLowerCase - 示例

import java.io.*;
public class Test {

   public static void main(String args[]) {
      String Str=new String("Welcome to Learnfk.com");

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

这将产生以下输出-

返回值 :welcome to learnfk.com

参考链接

https://www.learnfk.com/java/java-string-tolowercase-locale.html