Groovy - toUpperCase()



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

语法

String toUpperCase()

参数

返回值

大写的修改后的字符串。

示例

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

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

运行上述程序时,将获得以下结果 −

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