Just a little alias to capitalise the first letter of each word/token
Usage: $Initcaps(C,TEXT)[.Space]
Eg: $Initcaps(44,one,two,three) returns One,Two,Three
If the .Space property is specified the seperater token is replaced by a space
Eg: $initcaps(124,one|two|three) returns One Two Three
Also Completely unrelated to the snippet i just noticed that 'evolve' is spelt wrong at the top of this page
"This allows people to improve, adapt and evolove your code into something stronger and better"
Alias Initcaps {
if ($prop == Space) var %TokenChar = 32, %Token = $chr(32)
else var %TokenChar = $1, %Token = $chr($1)
if (%TokenChar != 44) tokenize %TokenChar $2-
var %x = $iif(%TokenChar == 44,2,1)
while (%x <= $0) {
var %ctok = $ [ $+ [ %x ] ]
if (%initcap) var %initcap = $+(%InitCap,%Token,$upper($left(%ctok,1)),$right(%ctok,-1))
else var %initcap = $+($upper($left(%ctok,1)),$right(%ctok,-1))
inc %x
}
return %InitCap
}