Here you can find the source of subString(String str)
public static String subString(String str)
//package com.java2s; import android.text.Html; public class Main { static String E1 = "[\u4e00-\u9fa5]"; public static String subString(String str) { str = Html.fromHtml(str, null, null).toString(); String temp = String.valueOf(str.charAt(str.length() - 1)); if (temp.matches(E1)) { return str.substring(0, str.length() - 2); }//w w w . j a va 2s . c om return str.substring(0, str.length() - 1); } }