]]> ]]>

CamelCase в Smalltalk

Пример для версий gst 3.1
text := stdin nextLine asLowercase.
text := text replacingAllRegex: '([^a-zA-Z]+)' with: ' '.
cc := ''.
text onOccurrencesOfRegex: '\b(\w+)\b' do: [ :each | 
    word := each match.
    cc := cc,((word copyFrom: 1 to: 1) asUppercase),(word copyFrom: 2 to: (word size)).
].
cc displayNl.

Комментарии

]]>

blog comments powered by Disqus

]]>

Работа программистам