CamelCase in Factor

Example for versions Factor 0.94

This example uses regular expressions. Word re-split (from regexp) splits a string into an array of strings separated by matches to the given regular expression. After this map combinator applies word >title (from unicode.case) to each element of the resulting array, converting them to title case. Finally, join (from sequences) concatenates the strings into one using “” as a separator.

USING: kernel io regexp sequences unicode.case ;

readln R/ [^a-zA-Z]+/ re-split
[ >title ] map
"" join print