Scala Char isValidByte() 方法与示例
isValidByte()方法用于查找指定的字符是否在 Byte 类型的范围内。
Method Definition: def isValidByte: Boolean
Return Type: It returns true if the stated character is in the range of type Byte else it returns false.
示例:1#
// Scala program of isValidByte()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isValidByte() method
val result = ('F').isValidByte
// Displays output
println(result)
}
}
输出:
true
示例:2#
// Scala program of isValidByte()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isValidByte() method
val result = ('\u0555').isValidByte
// Displays output
println(result)
}
}
输出:
false