Android examples for java.lang:String
is Start Zero Numeric
import android.text.TextUtils; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static boolean isStartZeroNumeric(String str) { String newStr = trim(str); Pattern pattern = Pattern.compile("^0\\d*$"); Matcher isNum = pattern.matcher(newStr); if (isNum.matches()) { return true; }// w ww . ja v a 2 s . com return false; } }