From: Joe Van Dyk Date: 2005-12-22T08:19:22+09:00 Subject: Re: String > Integer Conversion Problem On 12/21/05, James Edward Gray II wrote: > On Dec 21, 2005, at 4:39 PM, Matthew Feadler wrote: > > > Below, you can see that I'm checking command-line arguments to the > > program for various conditions. > > See if this gives you some ideas: > > if ARGV.all? { |n| n =~ /\A\d+\Z/ } > puts "Usage..." > exit > else > one, two = ARGV.map { |n| Integer(n) } > end Neat, didn't know about Enumerable#all? or about Integer().