Here you can find the source of getChineseLength(String value)
public static int getChineseLength(String value)
//package com.java2s; public class Main { public static int getChineseLength(String value) { int valueLength = 0; String chinese = "[\u0391-\uFFE5]"; for (int i = 0; i < value.length(); i++) { String temp = value.substring(i, i + 1); if (temp.matches(chinese)) { valueLength += 1;/*from w ww. jav a2 s . c o m*/ } } return valueLength; } }