Groovy - toLowerCase()



将此字符串中的所有字符转换成小写。

语法

String toLowerCase()

参数

返回值

转换成小写的修改后的字符串。

以下是该方法用法的一个示例 −

class Example { 
   static void main(String[] args) { 
      String a = "HelloWorld"; 
      println(a.toLowerCase()); 
   } 
}

当我们运行以上程序时,将获得以下结果 −

helloworld
groovy_strings.htm
广告
© . All rights reserved.