This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

isNaN function

 
Saurabh Naik
Ranch Hand
Posts: 87
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reg exps



Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64633
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic