Groovy toLowerCase()方法

2021-01-23 10:50 更新

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

句法

String toLowerCase()

参数

没有

返回值

小写的修改字符串。

下面是一个使用这个方法的例子 -

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

当我们运行上面的程序,我们将得到以下结果 -

helloworld
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号