Scala Char isControl() method with example
Last Updated :
03 Nov, 2019
The isControl() method is utilized to check whether the stated character is control character or not. Where, Control characters are formatting and other non-printing characters, such as ACK, BEL, CR, FF, LF, and VT.
Method Definition: def isControl: Boolean
Return Type: It returns true if the stated character is control character else it returns false.
Example: 1#
object GfG
{
def main(args : Array[String])
{
val result = 'a' .isControl
println(result)
}
}
|
Example: 2#
object GfG
{
def main(args : Array[String])
{
val result = '\n' .isControl
println(result)
}
}
|
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...