Scala Char isDigit() method with example
Last Updated :
29 Oct, 2019
The isDigit() method is utilized to check if the stated character is digit or not.
Method Definition: def isDigit: Boolean
Return Type: It returns true if the stated character is digit else it returns false.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = '9' .isDigit
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = 'g' .isDigit
println(result)
}
}
|
Share your thoughts in the comments
Please Login to comment...