Skip to content
Related Articles

Related Articles

Scala String toUpperCase() method with example
  • Last Updated : 29 Oct, 2019

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#

filter_none

edit
close

play_arrow

link
brightness_4
code

// 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)
      
    }

chevron_right


Output:

GEEKSFORGEEKS

Example: 2#

filter_none

edit
close

play_arrow

link
brightness_4
code

// 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)
      
    }

chevron_right


Output:

NID#!



My Personal Notes arrow_drop_up
Recommended Articles
Page :