Open In App

Scala Char isTitleCase() method with example

Last Updated : 03 Nov, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The isTitleCase() method is utilized to find if the stated character is a title-case character or not. A character is called title-case character if its general category type which is produced by Character.getType(ch), is a TITLECASE_LETTER.

Method Definition: def isTitleCase: Boolean

Return Type: It returns true if the stated character is Title-Case else it returns false.

Example: 1#




// Scala program of isTitleCase()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying isTitleCase() method 
        val result = '\u01f2'.isTitleCase
          
        // Displays output
        println(result)
      
    }


Output:

true

Example: 2#




// Scala program of isTitleCase()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying isTitleCase() method
        val result = ('T').isTitleCase
          
        // Displays output
        println(result)
      
    }


Output:

false


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads