From: Mayank Kohaley Date: 2011-10-04T19:17:01+09:00 Subject: Re: Noob alert, please help loops and arrays and string methods --001636af029a6310bf04ae7664ee Content-Type: text/plain; charset=UTF-8 On Tue, Oct 4, 2011 at 3:11 PM, Sathya Levy wrote: > I have a very simple assignment of creating a method to capitalize the > first letter in all words of any given sentence, yes it is a school > assignment, and yes I am an idiot. Anyway I have no idea how to use a > loop to add a string method .capitalize to all objects of an array > please help, I won't show you my code because I'm sure that all of you > can do this in your sleep. > > -- > Posted via http://www.ruby-forum.com/. > > Sorry guys for the top post. "this is an assignment, please try to do it yourself next time and ask for help if you want by posting the code which you write".split.map { |word| word.capitalize }.join(" ") -- Mayank Kohaley --001636af029a6310bf04ae7664ee--