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