带有示例的 Scala Char isMirrored() 方法
isMirrored()方法用于检查指定的字符值是否被镜像。例如:{}、[]、() 等。
Method Definition: def isMirrored: Boolean
Return Type: It returns true if the stated character is mirrored else it returns false.
示例: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