How to detect if a string contains any Right-to-Left character?
java, right-to-left, string
Solution
I came up with the following code:
char[] chars = s.toCharArray();
for(char c: chars){
if(c >= 0x600 && c <= 0x6ff){
//Text contains RTL character
break;
}
}
It's not a very efficient or for that matter an accurate way but can give one ideas.
Problem
I'm trying to make a method to detect strings written in right to left languages in Java. I've come up with this question doing something similar in C#. Now I need to have something like that but written in Java. Any help is appreciated.