Skip to content

Instantly share code, notes, and snippets.

@jschoolcraft
Created January 21, 2010 15:21
Show Gist options
  • Select an option

  • Save jschoolcraft/282870 to your computer and use it in GitHub Desktop.

Select an option

Save jschoolcraft/282870 to your computer and use it in GitHub Desktop.
[~] irb
irb(main):001:0> "jeff".to_i
=> 0
irb(main):002:0> Integer("jeff")
ArgumentError: invalid value for Integer: "jeff"
from (irb):2:in `Integer'
from (irb):2
irb(main):003:0> "23jeff".to_i
=> 23
irb(main):004:0> Integer("23")
=> 23
irb(main):005:0> Integer("23jeff")
ArgumentError: invalid value for Integer: "23jeff"
from (irb):5:in `Integer'
from (irb):5
irb(main):006:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment