Scala Char isSpaceChar() 方法与示例
isSpaceChar()方法用于检查所述字符是否为空格字符。
Method Definition: def isSpaceChar: Boolean
Return Type: It returns true if the stated character is space character else it returns false.
示例:1#
// Scala program of isSpaceChar()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isSpaceChar() method
val result = ('\u2028').isSpaceChar
// Displays output
println(result)
}
}
输出:
true
示例:2#
// Scala program of isSpaceChar()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isSpaceChar() method
val result = ('*').isSpaceChar
// Displays output
println(result)
}
}
输出:
false