Ruby strings are truthy, and they evaluate to zero, unless they start with a number.
> 'nine to five'.to_i
=> 0
> '9 to 5'.to_i
=> 9
Ruby strings are truthy, and they evaluate to zero, unless they start with a number.
> 'nine to five'.to_i
=> 0
> '9 to 5'.to_i
=> 9
Don’t miss my next essay
Hear from me immediately when I post: no ads, unsubscribe anytime.