Scala Char toLong() method with example
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