带有示例的 Scala Char getDirectionality() 方法
getDirectionality()方法用于返回指示 char 值的方向属性的字节。
Method Definition: def getDirectionality: Byte
Return Type: It returns byte.
示例:1#
// Scala program of getDirectionality()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying getDirectionality() method
val result = ('7').getDirectionality
// Displays output
println(result)
}
}
输出:
3
示例:2#
// Scala program of getDirectionality()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying getDirectionality() method
val result = 'B'.getDirectionality
// Displays output
println(result)
}
}
输出:
0