Truthy Strings
Ruby strings are truthy, and they evaluate to zero, unless they start with a number.
irb> 'nine to five'.to_i
=> 0
irb> '9 to 5'.to_i
=> 9
Tweet
Ruby strings are truthy, and they evaluate to zero, unless they start with a number.
irb> 'nine to five'.to_i
=> 0
irb> '9 to 5'.to_i
=> 9
Tweet