Skip to content
Related Articles

Related Articles

Improve Article

Scala Char isUnicodeIdentifierStart() method with example

  • Last Updated : 03 Nov, 2019
Geek Week

The isUnicodeIdentifierStart() method is utilized to find if the stated character is permissible as the first character in a Unicode identifier.
A character starts a Unicode identifier if and only if one of the below conditions is true:

  • isLetter(ch) returns true,
  • getType(ch) returns LETTER_NUMBER.

    Method Definition: def isUnicodeIdentifierStart: Boolean

    Return Type: It returns true if the stated character is permissible as the first character in a Unicode identifier else it returns false.

    Example: 1#




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

    Example: 2#




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



    My Personal Notes arrow_drop_up
  • Recommended Articles
    Page :