- see footer for list info -<
Use RegEx, looping trhough a list of words is ludicrous:-


<cfscript>
test = "VIRGIN ISLANDS";

test2 = reReplace(test, "(\b\w)(\w*)\b", "\U\1\E\L\2","ALL");
</cfscript>
<cfoutput>#test2#</cfoutput>



On 11/22/06, RichL <[EMAIL PROTECTED]> wrote:
>- see footer for list info -<
I have just found CapFirstTitle on CFLib which looks interesting

On 11/22/06, Damien Gallagher <[EMAIL PROTECTED]> wrote:
> >- see footer for list info -<
> I think there's a UDF to do just this on Ray Camden's site...
>
> RichL wrote:
> >> - see footer for list info -<
> > Hi Guys
> >
> > I have a country reference table where all of the country names are
> > held in upper case.
> >
> > I want to be able to output in lower case but keep the caps where
> > appropriate (e.g. UNITED KINGDOM to United Kingdom).
> >
> > However I think that this going to be close to impossible as there are
> > values such as:
> >
> > VIRGIN ISLANDS (BRITISH)
> > VIRGIN ISLANDS (U.S.)
> > WALLIS AND FUTANA
> >
> > So using a function to capitalise the first letter of each word won't
> > really work.
> >
> > How have people approached this situation and has anybody found any
> > good solution?
> >
> > Also, is there a UDF around for capitalising the first letter of each
> > word?
> >
> > Thanks in advance
> >
> _______________________________________________
>
> For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo
>
> --
> CFDeveloper Sponsors:-
> >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
> >- Lists hosted by www.Gradwell.com -<
> >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
>


--
Rich
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<



--
Simon Baynes
www.simonbaynes.com
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to