List of utility methods to do Chinese String Check
boolean | isChinese(String str) is Chinese Pattern pattern = Pattern.compile("[\u0391-\uFFE5]+$"); return pattern.matcher(str).matches(); |
boolean | isChinese(String strName) is Chinese char[] ch = strName.toCharArray(); for (int i = 0; i < ch.length; i++) { char c = ch[i]; if (isChinese(c)) { return true; return false; ... |
boolean | checkStringIsChinese(String str) check String Is Chinese if (null == str) { return false; Pattern pattern = Pattern.compile("[\\u4E00-\\u9FA5]+"); Matcher matcher = pattern.matcher(str); return matcher.matches(); |
boolean | isChinese(char c) is Chinese Character.UnicodeBlock ub = Character.UnicodeBlock.of(c); if (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS || ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS || ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A || ub == Character.UnicodeBlock.GENERAL_PUNCTUATION || ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION || ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS) { return true; ... |
Boolean | isChinese(String str) is Chinese Boolean isChinese = true; String chinese = "[\u0391-\uFFE5]"; if (!isEmpty(str)) { for (int i = 0; i < str.length(); i++) { String temp = str.substring(i, i + 1); if (temp.matches(chinese)) { } else { isChinese = false; ... |
Boolean | isContainChinese(String str) is Contain Chinese Boolean isChinese = false; String chinese = "[\u0391-\uFFE5]"; if (!isEmpty(str)) { for (int i = 0; i < str.length(); i++) { String temp = str.substring(i, i + 1); if (temp.matches(chinese)) { isChinese = true; } else { ... |
boolean | hasChinese(String key) has Chinese try { Pattern pattern = Pattern.compile("[\u4e00-\u9fa5]+"); Matcher matcher = pattern.matcher(key); if (matcher.find()) { return true; } catch (Exception e) { e.printStackTrace(); ... |