📜  Scala Char isSpaceChar() 方法与示例

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

Scala Char isSpaceChar() 方法与示例

isSpaceChar()方法用于检查所述字符是否为空格字符。

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