retrieve digit from token

StringTokenizer st = new StringTokenizer (input); String s=st.nextToken();while(st.hasMoreTokens()){what would be the expression that allows me to test if the string represents a digit and retrieve itI tried isDigit(), but does not workThanks
[285 byte] By [veroknotta] at [2007-10-2 15:00:14]
# 1

String s = null;

int iTokenCount = sTokenizer.countTokens();

for (int iCnt = 0; iCnt < iTokenCount; iCnt++) {

s = st.nextToken();

if (!isAllCharactersAreNumeric(s)) {

return false;

}

}

private boolean isAllCharactersAreNumeric(String s) {

if (s != null) {

for (int i = 0; i < s.length(); i++) {

char c = s.charAt(i);

if (!isNumeric(c)) {

return false;

}

}

}

return true;

}

private boolean isNumeric(char c) {

if (!(c > 47 && c < 58))

{

return false;

}

return true;

}

HTH

BinigeriMaheshReddya at 2007-7-13 13:45:42 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...