[Newbies] a titleize function?
ennoausberlin at mac.com
Fri Mar 19 08:56:36 UTC 2010
sergio_101 <sergiolist at village-buzz.com> writes:
> is there a function that can do this:
> 'a mouse ate cheese' . 'A Mouse Ate Cheese'
> i found capitlize, but that only hits the first word..
There is a shorter way, I guess, but
('a mouse ate cheese' substrings inject: '' into: [:start :each | start,
' ', each capitalized])
does it for me.
More information about the Beginners