From: ara.t.howard@... Date: 2006-11-18T03:15:19+09:00 Subject: Re: ruby equivalent PHP function is_numeric? On Sat, 18 Nov 2006, Jason Dusek wrote: > On 11/17/06, Josselin wrote: >> After reading completely my Ruby book, I cannot find a function >> equivalent to the PHP is_numeric? to test a String > > There is no such function, although you can pretty readily use regexes > to do it... > > It really is too bad that String.to_f does not throw an exception - or > at least return NaN - when the string is not a number. use Float(a_string) it does throw. -a -- my religion is very simple. my religion is kindness. -- the dalai lama