has Chinese By Regex - Java Internationalization

Java examples for Internationalization:Chinese

Description

has Chinese By Regex

Demo Code


//package com.java2s;

import java.util.regex.Pattern;

public class Main {

    public static boolean hasChineseByReg(String str) {
        if (str == null) {
            return false;
        }/*from w  w w . j av  a  2 s.  c  o m*/
        Pattern pattern = Pattern.compile("[\\u4E00-\\u9FBF]+");
        return pattern.matcher(str).find();
    }
}

Related Tutorials