This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes isNaN function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "isNaN function" Watch "isNaN function" New topic
Author

isNaN function

Saurabh Naik
Ranch Hand

Joined: Apr 24, 2008
Posts: 87
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 .


SCJP 6 (88%), SCWCD 5 (78%), preparing for SCBCD
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Reg exps



Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: isNaN function
 
Similar Threads
Validating alpha and numeric chars in a form
validte amount with javascript?
help
Input field validations
how to take either String or numbers..in textbox