10 lines
109 B
Ruby
10 lines
109 B
Ruby
|
|
def is_numeric?(s)
|
||
|
|
begin
|
||
|
|
Float(s)
|
||
|
|
rescue
|
||
|
|
false # not numeric
|
||
|
|
else
|
||
|
|
true # numeric
|
||
|
|
end
|
||
|
|
end
|