Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Testing for an integer in java

Name: Anonymous 2007-04-19 19:54 ID:OeZSnxtN

I was just wondering if there was a simple and easy way to test if a string(single char string) is a number.

Maybe some method I do not know about, or maybe something like

if (string[1].equals(\\#))

Any thoughts?

Name: Anonymous 2007-04-19 20:31 ID:OeZSnxtN

But I don't want to parse the string. I just want to test it to see if it is an integer or not.

I could probably use exception handling to see if it will parse or not, but I was just wondering if there is an easier way.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List