I have edittext in a form, I want that when the user inputs text into the edittext for my program to detect which language was inserted into the edittext.
Is there a way to determine a string is English or Persian?
I found this code for Arabic
public static boolean isProbablyArabic(String s) {
for (int i = 0; i < Character.codePointCount(s, 0, s.length()); i++) {
int c = s.codePointAt(i);
if (c >= 0x0600 && c <=0x06E0)
return true;
}
return false;
}
but how can I change this code for Persian?