is Chinese Character by regex - Android java.util.regex

Android examples for java.util.regex:Phone Number Pattern

Description

is Chinese Character by regex

Demo Code


//package com.java2s;

public class Main {

    public static final boolean isChineseCharacter(String chineseStr) {
        char[] charArray = chineseStr.toCharArray();
        for (int i = 0; i < charArray.length; i++) {
            if ((charArray[i] >= 0x4e00) && (charArray[i] <= 0x9fbb)) {
                return true;
            }//  www .  j  a  va  2 s.  c om
        }
        return false;
    }
}

Related Tutorials