has Chinese By Char Range - Java Internationalization

Java examples for Internationalization:Chinese

Description

has Chinese By Char Range

Demo Code


//package com.java2s;

public class Main {

    public static boolean hasChineseByCharRange(String str) {
        if (str == null) {
            return false;
        }/*from   www  .  j a  v a2s . c o m*/
        char[] ch = str.toCharArray();
        for (char c : ch) {
            if (c >= 0x4e00 && c <= 0x9fbf) {
                return true;
            }
        }
        return false;
    }
}

Related Tutorials