Scala Char toString() method with example
Last Updated :
29 Oct, 2019
The toString() method is utilized to convert a stated character into String.
Method Definition: def toString: String
Return Type: It returns the String representation of the stated character.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = 'B' .toString
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = 'b' .toString
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...