Is there a way to determine a string is English or Arabic?
This answer is somewhat correct. But when we combine Farsi and English letters it returns TRUE!, which is not true. Here I modified the same method so that it works well
public static boolean isProbablyArabic(String s) {
for (int i = 0; i < s.length();) {
int c = s.codePointAt(i);
if (!(c >= 0x0600 && c <= 0x06E0))
return false;
i += Character.charCount(c);
}
return true;
}