01-21-2010, 02:01 AM
Function Proper
function str&content
// convert to Proper Case (first letters only capitalized)
// example
// str s = "jOHN q public"
// Proper(s) ;; s is now "John Q Public"
content.lcase
ARRAY(str) arr
int i nt
nt = tok(content arr -1 " ")
content = ""
for(i 0 nt)
,str c.get(arr[i] 0 1)
,c.ucase
,arr[i].set(c 0 1)
,content.from(content " " arr[i])
content.replacerx("^ ")