Scala Char toDouble() method with example
Last Updated :
29 Oct, 2019
The toDouble() method is utilized to convert a stated character into Double or its ASCII value of type Double.
Method Definition: def toDouble: Double
Return Type: It returns Double or ASCII value of the corresponding letter of type Double.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = '\u0051' .toDouble
println(result)
}
}
|
Here, ‘\u0051’ is uni-code representation of Q.
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = '\n' .toDouble
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...