Here you can find the source of isNumeric(String value)
Parameter | Description |
---|---|
value | the value. |
public static boolean isNumeric(String value)
//package com.java2s; import java.util.regex.Pattern; public class Main { private static final Pattern NUMERIC_PATTERN = Pattern .compile("^(-?0|-?[1-9]\\d*)(\\.\\d+)?$"); /**// ww w .jav a2s .c o m * Indicates whether the given value is numeric. * * @param value the value. * @return true or false. */ public static boolean isNumeric(String value) { return NUMERIC_PATTERN.matcher(value).matches(); } }