Android examples for java.util.regex:Digit Pattern
filter First Zero by regular expression
import android.text.TextUtils; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static String filterFirstZero(String str) { if (!str.contains(".")) { return str.replaceFirst("^0*", ""); }/*from w ww.ja v a2 s. co m*/ return str; } }