• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

isNaN function

 
Saurabh Naik
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isNaN function only checks first letter in string.. but what suppose I have string like sa89bh.

is there any function for recognizing numbers in string ?

which are the built in functions in java script .
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reg exps



Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the first letter is not a numeral, that's all isNan needs to know to determine if it's a number of not.

If you are trying to find embedded numbers, why would you use isNan? I'd consider exploring regular expressions.

Edit: As Eric suggested while I was posting.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic