Actually, one more version, less ugly:

<cfset str = " This is the title of an article. ">
<cfset titles =
uCase(REReplace(str,"[[:space:]]*([^[:space:]])[^[:space:]]+[[:space:]]*
","\1","all"))>
<cfoutput>#titles#</cfoutput>

=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Hatton Humphrey [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, March 21, 2002 11:41 AM
> To: CF-Talk
> Subject: Re: String Magic: Extract initial character of words 
> in a string
> 
> 
> Maybe something along the lines of:
> 
> <cfset final="">
> <cfloop list="#form.entry#" delimiters=" " index="word">
>     <cfset final = listappend(final, UCase(left(word, 1)))
> </cfloop>
> 
> That would give you a comma separated list of each letter 
> that you could 
> do any number of things with.
> 
> HTH
> Hatton
> 
> Disclaimer: The code presented has NOT be tested for syntax.... gotta 
> leave you *something* to do.
> 
> Edward McDermott wrote:
> 
> > I want to be able to take a string, for example a journal 
> article title, and
> > parse out just the initial characters of each word.  For 
> example: "This is a
> > Cold Fusion Article" becomes "TIACFA".  Thanks in advance.
> > 
> > Ed
> > 
> > Edward J. McDermott
> > Systems Librarian
> > Robert H. Goddard Library
> > Clark University
> > 950 Main Street
> > Worcester, MA 01610
> > (508) 793-7651
> > (508) 793-8871 [FAX]
> > [EMAIL PROTECTED]
> > 
> > 
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to