From: Matthew Feadler Date: 2005-12-23T03:47:04+09:00 Subject: Re: String > Integer Conversion Problem First, thanks all very much for the lively discussion thus far. It's proven very useful. Timothy Hunter wrote: > The Integer() method raises ArgumentError if given an empty, > non-numeric, or otherwise non-well-formed string. Hmm...apparently not--at least not w/ 1.8.2 on mswin32. This: begin one, two = ARGV.map{ |n| Integer(n) } rescue ArgumentError puts "Usage..." exit end puts one puts two Outputs: nil nil When fed no command-line arguments. It does work as intended if any of the args are non-empty strings, however. Also: raise "Hey, '#{ arg }' needs to be a number" if !arg.match(/^\d*$/) I'm a regexp neophyte, without skill or clue. Any suggestions on tutorials? Thanks, -Matthew -- Posted via http://www.ruby-forum.com/.