public static boolean containsRTLText ( String str ) { if ( str != null ) { for ( int i = 0 ; i < str . length ( ) ; i ++ ) { char cc = str . charAt ( i ) ; // hebrew extended and basic, arabic basic and extendend if ( cc >= 1425 && cc <= 1785 ) { return true ; } // alphabetic presentations forms (hebrwew) to arabic presentation forms A else if ( cc >= 64286 && cc <= 65019 ) { return true ; } // arabic presentation forms B else if ( cc >= 65136 && cc <= 65276 ) { return true ; } } } return false ; }
Detects arabic characters in a string .