📜  带有示例的 Scala Char isMirrored() 方法

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

带有示例的 Scala Char isMirrored() 方法

isMirrored()方法用于检查指定的字符值是否被镜像。例如:{}、[]、() 等。

示例:1#

// Scala program of isMirrored()
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying isMirrored() method 
        val result = ('{').isMirrored
          
        // Displays output
        println(result)
      
    }
} 
输出:
true

示例:2#

// Scala program of isMirrored()
// method
  
// Creating object
object GfG
{ 
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying isMirrored() method
        val result = ('A').isMirrored
          
        // Displays output
        println(result)
      
    }
} 
输出:
false