带有示例的 Scala Char reverseBytes() 方法
reverseBytes()方法用于查找通过反转指定 char 值中的字节序列获得的值。
Method Definition: def reverseBytes: Char
Return Type: It returns Char.
示例:1#
// Scala program of reverseBytes()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying reverseBytes() method
val result = '\u4d00'.reverseBytes
// Displays output
println(result)
}
}
输出:
M
示例:2#
// Scala program of reverseBytes()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying reverseBytes() method
val result = '\u5d00'.reverseBytes
// Displays output
println(result)
}
}
输出:
]