Open In App

Scala String toUpperCase() method with example

Last Updated : 29 Oct, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The toUpperCase() method is utilized to convert all the characters of the stated string to uppercase.

Method Definition: String toUpperCase()

Return Type: It returns the resultant string after converting its all the character to uppercase.

Example: 1#




// Scala program of toUpperCase()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying toUpperCase method
        val result = "GeeksforGeeks".toUpperCase()
          
        // Displays output
        println(result)
      
    }


Output:

GEEKSFORGEEKS

Example: 2#




// Scala program of toUpperCase()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying toUpperCase method
        val result = "nid#!".toUpperCase()
          
        // Displays output
        println(result)
      
    }


Output:

NID#!


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads