Open In App

Scala Char toTitleCase() method with example

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

// Creating object
object GfG
{ 

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

// Creating object
object GfG
{ 

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

Next Article

Similar Reads