Open In App

Scala Char toUpper() method with example

Last Updated : 11 Nov, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
The toUpper() method is utilized find the uppercase of the stated character value.
Method Definition: def toUpper: Char Return Type: It returns Char.
Example: 1# Scala
// Scala program of toUpper()
// method

// Creating object
object GfG
{ 

    // Main method
    def main(args:Array[String])
    {
        // Applying toUpper() method 
        val result = 'a'.toUpper
        
        // Displays output
        println(result)
    
    }
} 
Output:
A
Example: 2# Scala
// Scala program of toUpper()
// method
// Creating object
object GfG
{ 

    // Main method
    def main(args:Array[String])
    {
        // Applying toUpper() method
        val result = 'b'.toUpper
        
        // Displays output
        println(result)
    
    }
} 
Output:
B

Next Article

Similar Reads