Open In App

Scala String toUpperCase() method with example

Last Updated : 29 Oct, 2019
Comments
Improve
Suggest changes
Like Article
Like
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
// 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
// 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#!

Next Article

Similar Reads