The Fake Geek's blog: Check if a string is a number
A very simple question. I use the traditional check-every-character way. 1. if the character is '-' but is not at the beginning of the string, return false;
2. else if there are more than one dots in the string, return false;
3. else if other characters are not digits, return false.
Read full article from The Fake Geek's blog: Check if a string is a number
No comments:
Post a Comment