Scala Char isLowSurrogate() 方法与示例
isLowSurrogate()方法用于查找指定的 char 值是否为 Unicode 低代理代码单元。这些值本身并不表示字符,而是用于表示 UTF-16 编码中的补充字符。
Method Definition: def isLowSurrogate: Boolean
Return Type: It returns true if the stated character is Low-surrogate else it returns false.
示例:1#
// Scala program of isLowSurrogate()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isLowSurrogate() method
val result = '\udc28'.isLowSurrogate
// Displays output
println(result)
}
}
输出:
true
示例:2#
// Scala program of isLowSurrogate()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying isLowSurrogate() method
val result = ('a').isLowSurrogate
// Displays output
println(result)
}
}
输出:
false