Android examples for java.util.regex:Number Pattern
is a string a Number by regex
import android.content.Context; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static Boolean isNumber(String str) { Boolean isNumber = false; String expr = "^[0-9]+$"; if (str.matches(expr)) { isNumber = true;//w w w . j ava 2s .com } return isNumber; } }