Is String a English word - Android Internationalization

Android examples for Internationalization:English

Description

Is String a English word

Demo Code

public class Main{

    public static boolean strIsEnglish(String word) {
        // boolean sign = true; // ???????'true'
        for (int i = 0; i < word.length(); i++) {
            if (!(word.charAt(i) >= 'A' && word.charAt(i) <= 'Z')
                    && !(word.charAt(i) >= 'a' && word.charAt(i) <= 'z')) {
                return false;
            }/*from  w  w w . j  ava2  s .  c  o m*/
        }
        return true;
    }

}

Related Tutorials