Android examples for java.util.regex:Blank Remove
remove Empty Char by regular expression
import android.text.TextUtils; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Random; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static String removeEmptyChar(String src) { if (src == null || src.length() == 0) return src; return src.replaceAll("[\r]*[\n]*[ ]*[ ]*", ""); }/* www . j ava2 s .co m*/ }