From: koichirose Date: 2008-05-27T20:14:15+09:00 Subject: Re: A simple newbie question (arrays and strings) koichirose wrote: > Yes, .downcase, confirmed I have a problem, why does this work: list = Dir.entries('.')[2..-1].map{|f| f.split(' - ')[0].capitalize} And this doesn't? list2 = Dir.entries('.')[2..-1].map{|f| f.split(' - ')[1].capitalize} It returns: hello.rb:7: undefined method `capitalize' for nil:NilClass (NoMethodError) from hello.rb:7:in `map' Thank you