Here you can find the source of hasChinese(String key)
public static boolean hasChinese(String key)
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean hasChinese(String key) { try {// w ww . j a v a 2 s . c om Pattern pattern = Pattern.compile("[\u4e00-\u9fa5]+"); Matcher matcher = pattern.matcher(key); if (matcher.find()) { return true; } } catch (Exception e) { e.printStackTrace(); } return false; } }