Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Little text functions
#5
Function Proper
Code:
Copy      Help
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("^ ")


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)