Err... so what's the CSS one? And does it work reliably in IE? Sadly my
client is using IE and is unlikely to change.

The RegExp version looks interesting, although I confess to zero
understanding of what it's doing. Might try it out this afternoon and see
what I get. Thanks. :)

Seona.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Adam
> Cameron
> Sent: Tuesday, 10 August 2004 10:49 AM
> To: CFAussie Mailing List
> Subject: [cfaussie] Re: Is there a title case function?
> 
> 
> On Mon, 09 Aug 2004 18:24:33 +1000, Geoff Bowers wrote:
> > You might try CFLIB.org for all your function needs:
> >   CapFirstTitle()
> > TitleCaseList()
> 
> Here's another couple of techniques.  One using regular expressions, one
> using CSS.
> 
> The RegExp is not completely foolproof (as the example shows), 
> but it saves
> all that looping about the place that the CFLIB UDFs seem to like doing.
> 
> I think the CSS solution is the best one, to be honest.
> 
> <cfscript>
>       testStr = "this is a test sentence,it has punctuation and 
> it's also got a
> couple of apostrophe's (sic).the function should cap-first all words,i
> hope.plural numbers like 2s and 3s seem to work,too,for some
> reason.it,however,preserves wholly CAPITALISED word(s)";
>       regExp1 = "(^\b|[^\w'])(\w)";
>       regExp2 = "\1\u\2";
>       writeOutput(reReplace(testSTr, regExp1, regExp2, "ALL") & "<br />");
>       writeOutput('<span 
> style="text-transform=capitalize">#testStr#</span><br
> />');
> </cfscript>
> 
> 
> -- 
> 
> Adam Cameron
> Senior Application Developer
> Straker Interactive
> 
> E: [EMAIL PROTECTED]
> T: +64 9 3095252
> F: +64 9 3092797
> W: www.straker.co.nz
> 
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to 
> [EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.733 / Virus Database: 487 - Release Date: 2/08/2004
> 

__________________________________________________________________
<< ella for Spam Control >> has removed Spam messages and set aside Later
for me
You can use it too - and it's FREE!  http://www.ellaforspam.com

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.733 / Virus Database: 487 - Release Date: 2/08/2004
 

<<attachment: winmail.dat>>

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to