Android examples for Internationalization:Chinese
get String Length for Chinese
public class Main{ public static int getStringLength(String string) { int valueLength = 0; String chinese = "[\u4e00-\u9fa5]"; for (int i = 0; i < string.length(); i++) { String temp = string.substring(i, i + 1); if (temp.matches(chinese)) { valueLength += 2;/*from ww w . j ava 2 s . c om*/ } else { valueLength += 1; } } return valueLength; } }