JRS: In article <Y9Cwf.1763$%W3 .364@trndny07>, dated Mon, 9 Jan 2006
23:17:12 local, seen in news:comp.lang. javascript, mrHoo
<dr***@yankeewe b.com> posted :
If you do this a lot stretch the String.prototyp e:
String.prototy pe.gotNum=funct ion(){
return /\d/.test(this)
}
otherwise
function gotNum(str){
return /\d/.test(str)
}
If you do it, do it right. The test is for a digit, not for a number,
and should be named accordingly.
R2D2 & C3PO have digits in their names, but not numbers.
HM Queen Elizabeth II and William Gates III have a number in their IDs,
but no digits.
--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demo n.co.uk/> - FAQqish topics, acronyms & links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.