In that case, just run a loop from the beginning to the end of the string, checking to see if each character is between '0' and '9' inclusive. If any don't match or the string is of zero length, it's not an integer. Otherwise it is.
I FEEL NOTHING FOR YOU. I HOLD MYSELF DOWN. KEEP TO YOURSELF. YOU SHOULDN'T TOUCH ME. THE SKIN PEELS OFF MY BONES. I'LL GIVE YOU A GIFT, TAKE THE SKIN FROM MY STOMACH AND STRETCH IT ACROSS YOUR FACE. LOOK IN THE MIRROR, I SEE MYSELF THROUGH YOUR EYES. MY BODY'S ON THE GROUND BEHIND YOU. YOU USE IT TO AMUSE YOURSELF. WHEN YOU KICK IT AROUND THE ROOM YOU FEEL THE IMPACT OF MY BOOT IN YOUR STOMACH. CRY FOR ME, BLAME ME FOR THE FACT YOU NO LONGER RECOGNIZE YOURSELF. LYING HERE, I WANT THE AIR IN THIS ROOM TO CONSUME ME, TO TO PULL MY BODY IN BEHIND ITSELF WHILE YOU STARE DOWN AT ME, UNCERTAIN IF YOU'VE LOST YOURSELF IN ME. YOU'RE RUNNING YOUR HANDS ALONG THE LEATHER SURFACE OF YOUR SKIN. THE SOUND THIS MAKES CHANGES PITCH ACCORDING TO THE AREA OF YOUR BODY YOU TOUCH, YOUR THIGHS AND YOUR GROIN RELEASE A LOW HUM, THE SOUND OF MY CORPSE RELEASING DEAD AIR WHEN YOU KICK ME. YOUR FACE GENERATES A CONTINUOUS HIGH-PITCHED SQUEAL, THE SOUND I MAKE WHEN YOU BURN ME. I TAKE YOU OVER, YOU FORGET YOURSELF IN MY BODY, WHEN YOU CHEW A PIECE OF SKIN FROM YOUR FINGER YOU REMEMBER MY BODY IN YOUR MOUTH. MY BONES CRACK BETWEEN YOUR TEETH. I LOVE YOU. WHEN YOU LICK YOUR HAND YOUR SWEAT TASTES LIKE MY BLOOD. CONCEAL YOURSELF. CLOSE YOURSELF OFF. PULL BACK INTO MY SKIN. I'M INSIDE YOU. THE PLACE ON THE FLOOR WHERE MY BODY DECAYED LEFT A STAIN ON YOUR MEMORY. THAT'S A SIGNATURE OF MY LOVE FOR YOU. YOU CAN'T FORGET ME WITHOUT LOSING YOURSELF. I'LL NEVER DIE.
Name:
Anonymous2007-04-20 6:55 ID:V9osOUg+
>>1
Check the docs on java.util.regex (the only useful part of the Java library, and still comes with a retarded interface), and use Perl-compatible regular expressions to check for:
/^\s*-?\d+\s*$/
For floating point numbers:
/^\s*-?(?:\.\d+|\d+)\s*$/
public IsStringAnInteger getInstance() {
if (instance == null) {
instance = new IsStringAnInteger();
}
return instance;
}[code]public class IsStringANumber {
private static IsStringANumber instance;
public IsStringANumber getInstance() {
if (in
public bool isStringAnInteger(String isThisStringAnInteger) {
boolean stringIsAnInteger = false;
int min = getMinimumInteger();
int max = getMaximumInteger();
for (int val = min; val <= max; val++) {
Integer integer = new Integer(val);
String stringWhichIsAnInteger = integer.toString();
if (isThisStringAnInteger.equals(stringWhichIsAnInteger)) {
stringIsAnInteger = true;
}
}
return stringIsAnInteger;
}
private int getMinimumInteger() {
return Integer.MIN_VALUE;
}
private int getMaximumInteger() {
return Integer.MAX_VALUE;
}
}
I KNOW BECAUSE I AM AN EXPERT JAVA PROGRAMMER
Name:
Anonymous2007-04-20 7:15 ID:l6Bved/C
C:
main() {
char c = '9';
if(isdigit(c)) printf("%c is a number! \n", c);
}
Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy