Tag:logs span string asc mpi Custom http char color
// method one: function with Java public static boolean " Span style= "COLOR: #000000" > IsNumeric (String str) { for (int i = str.length ();--i>=0;) { if (! Character.isdigit (Str.charat (i)) { return false ; }} return true
/* method Two: recommended, fastest (disputed) * Determine if integer * @param str The string passed in * @return is an integer that returns true, otherwise false */ Public static boolean Isinteger (String str) {pattern pattern = Pattern.compile (" ^[-\\+]?[ \\d]*$ "); return Pattern.matcher (str). matches (); }
// method Three: Public static boolean IsNumeric (String str) {pattern pattern = Pattern.compile (" [0-9]* " return Pattern.matcher (str). matches (); }
// method four: Public final static boolean IsNumeric (String s) { if (s! = null &&! "" " .equals (S.trim ())) return s.matches ("^[0-9]*$" else return false ;}
public static Boolean isnumeric (String str) {for ( int i=str.length ();--i>=0;) { int chr=str.charat (i); if (chr<48 | | chr>57) return false ; } return true ;}
Turn from: https://www.cnblogs.com/heyuxiu/p/5972187.html [Thank you very much:)]
Java custom method for determining whether a string is a number