Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Uppercase/Lowercase

 [1/4] from: rondon:andrade:uol at: 19-May-2001 9:56


Hi! Does anybody has an script to make initials of phrases in Uppercase? str: "INFORMATION MANAGEMENT JOURNAL" return str probe str Information Management Journal because after that I can use a string with stopwords to change articles, prepositions, etc.. using replace... Thanks in advance. Rondon

 [2/4] from: gjones05::mail::orion::org at: 19-May-2001 8:34


From: "Rondon Andrade"
> Does anybody has an script to make initials of phrases in Uppercase? > > str: "INFORMATION MANAGEMENT JOURNAL" > return str > > probe str > "Information Management Journal" > > because after that I can use a string with stopwords to change
articles,
> prepositions, etc.. using replace... > > Thanks in advance.
Hi, Rondon, Here is a quick and dirty function I cooked up. init-cap: func [in-str [string!] /local nstr][ nstr: copy "" foreach s parse lowercase in-str none [ append nstr rejoin [ s/1: to-char uppercase to-string s/1 " "] ] trim nstr ] ;=== ;use like the following: str: "INFORMATION MANAGEMENT JOURNAL" str: init-cap str ; yields str set to "Information Management Journal" Hope this helps. --Scott Jones

 [3/4] from: john:schuhr at: 19-May-2001 9:22


Hi Rondon.. not sure if I understood your post completely, but maybe you wanted something like this? capitalise: func ["Capitalizes all english words in specified string." raw-string [string!]][ new-str: make string! none foreach word-item (parse raw-string none) [ new-str: rejoin [new-str (uppercase/part lowercase word-item 1) " "] ] return trim new-str ]
>> str: "INFORMATION MANAGEMENT JOURNAL"
== "INFORMATION MANAGEMENT JOURNAL"
>> capitalise str
== "Information Management Journal" --John Schuhr At 09:56 AM 5/19/2001 -0300, you wrote:

 [4/4] from: rondon:andrade:uol at: 19-May-2001 11:47


Hi Everybody!! It worked really fine.! Thank you very much!! Rondon