I need a function, is_an_integer, where
"12".is_an_integer? returns true
"blah".is_an_integer? returns false
how can i do this in ruby? i would write a regex but im assuming there is a helper for this that i am not aware of
I need a function, is_an_integer, where
"12".is_an_integer? returns true
"blah".is_an_integer? returns false
how can i do this in ruby? i would write a regex but im assuming there is a helper for this that i am not aware of
I'm not sure if this was around when this question is asked but... For anyone that stumbles across this post, the simplest way is
.is_a? will work with any object!