Java Character. getDirectionality (int codePoint)

Syntax

Character.getDirectionality(int codePoint) has the following syntax.

public static byte getDirectionality(int codePoint)

Example

In the following code shows how to use Character.getDirectionality(int codePoint) method.


//w  ww. j  a va  2 s .c om
public class Main {
   public static void main(String[] args) {
      char ch1 = 'M', ch2 = '\u06aa';

      byte b1 = Character.getDirectionality(ch1);
      byte b2 = Character.getDirectionality(ch2);

      if(b1 == 0){
        System.out.println("DIRECTIONALITY_LEFT_TO_RIGHT");
      }
      if(b2 == 2){
        System.out.println("DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC");
      }
   }
}




















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable