Groovy - toUpperCase()


Advertisements

Converts all of the characters in this String to upper case.

Syntax

String toUpperCase()

Parameters

None

Return Value

The modified string in upper case.

Example

Following is an example of the usage of this method −

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

When we run the above program, we will get the following result −

HELLOWORLD
groovy_strings.htm
Advertisements