Skip to content
Related Articles

Related Articles

Improve Article
Scala Char toLong() method with example
  • Last Updated : 03 Nov, 2019

The toLong() method is utilized to convert a stated character into Long or its ASCII value of type Long.

Method Definition: def toLong: Long

Return Type: It returns Long or ASCII value of the corresponding letter of type Long.

Example: 1#




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

Example: 2#




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



My Personal Notes arrow_drop_up
Recommended Articles
Page :