Open In App

Scala Char toTitleCase() method with example

Last Updated : 11 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
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 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 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


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads