Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request for a sample to learn from
#7
combining two functions...

Member function str.CapWords2
Code:
Copy      Help
;/

;Capitalizes first character of each word.

;EXAMPLE
;str s="quick macros"
;s.CapWords
;out s ;;"Quick Macros"

ARRAY(lpstr) a
this.lcase
tok this a
int i
for i 0 a.len
,if(a[i][0]<128)
,,a[i][0]=toupper(a[i][0])
,else
,,BSTR b=a[i]
,,b[0]=CharUpperW(+b[0])
,,a[i]=b

Macro Macro23
Code:
Copy      Help
out
str text="this is a test of three lines.[]how can I help you.[]line three"
out text
out "----"
text.CapWords2
out text
out "----"
text.Sort(6)
out text


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)