[Newbies] a titleize function?

Enrico Schwass ennoausberlin at mac.com
Fri Mar 19 08:56:36 UTC 2010


sergio_101 <sergiolist at village-buzz.com> writes:

Hello

> 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.

bye
Enno


More information about the Beginners mailing list