Ansichten: QuotePaste - CodePaste - NoPaste
Codesnippet eingetragen am 25.1.2012 um 09:21
Von: Michael
Sprache: Java
Beschreibung: Boolean check if a string is numeric
CodeSnippet:
  1. public static boolean isNumeric(String inputstring){
  2. for (int i = 0; i < inputstring.length(); i++) {
  3. //If we find a non-digit character we return false.
  4. if (!Character.isDigit(inputstring.charAt(i)))
  5. return false;
  6. }
  7. return true;
  8. }