From: Sam Rudd Date: 2008-04-08T22:41:49+09:00 Subject: Re: simple, simple array question ------=_Part_16669_23150181.1207662107591 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm hardly any good at Ruby yet, but isn't "Test" already capitalized? Maybe that's why it's nil? On Tue, Apr 8, 2008 at 2:35 PM, Peter Bailey wrote: > Hi, > I need to cap-and-lowercase words in strings of XML data. Why is this > happening in this test? > > stuff = [ "This", "is", "a", "test" ] > stuff.collect { |x| puts x.capitalize! } > > I get: > > nil > Is > A > Test > > Program exited with code 0 > > What's with the "nil?" > > Thanks, > Peter > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_16669_23150181.1207662107591--