From: Hassan Schroeder Date: 2011-11-07T07:27:57+09:00 Subject: Re: "A" and "an" articles in front of words On Sun, Nov 6, 2011 at 12:59 PM, steve ross wrote: > def article_for(noun) >  article = %w(a e i o u).include?(noun[0..0]) ? 'an' : 'a' >  "#{article} #{noun}" > end > > irb(main):022:0> article_for 'dog' > => "a dog" > irb(main):023:0> article_for 'animal' > => "an animal" > article_for 'unicorn' => "an unicorn" # => oops :-) -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com http://about.me/hassanschroeder twitter: @hassan