Greetings,
I am developing GWT application where user can enter his details in Japanese. But the \'userid\' and \'password\' should only contain English characters(L
For something this simple, I'd use a regular expression.
private static final Pattern p = Pattern.compile("\\p{Alpha}+"); static boolean isValid(String input) { Matcher m = p.matcher(input); return m.matches(); }
There are other pre-defined classes like \w that might work better.
\w