📜  Scala Char isValidByte() 方法与示例

📅  最后修改于: 2022-05-13 01:55:47.609000             🧑  作者: Mango

Scala Char isValidByte() 方法与示例

isValidByte()方法用于查找指定的字符是否在 Byte 类型的范围内。

示例: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