From: Sam Rudd Date: 2008-04-08T22:42:48+09:00 Subject: Re: simple, simple array question ------=_Part_16674_22112926.1207662159748 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Sorry, I meant "This" already capitalized. Try it lowercase? On Tue, Apr 8, 2008 at 2:41 PM, Sam Rudd wrote: > 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_16674_22112926.1207662159748--