Personally, I would put the values into proper case before putting them into
the database. That means you only have to process the text once... Not once
for each time you read it from the database.
...
Ben Nadel
www.bennadel.com
-Original Message-
From: Richard
Try using CapFirst() from cflib.org, works great, though you will still have
to write a regex for things like McMillan.
Thanks,
Mark
-Original Message-
From: Richard Dillman [mailto:[EMAIL PROTECTED]
Sent: Monday, August 07, 2006 5:14 PM
To: CF-Talk
Subject: Proper Case
Just wondering
If you want to change the case of all the elements in the form
structure, you could loop of them like so:
cfloop list=#structKeyList(form)# index=field
cfset form[field] = ucase(form[field])/
/cfloop
Or, you could loop over a subset of field names just to modify the
ones you want to
Joe I like your idea Ben mentioned Converting to Proper before Updating the
DB
SO:
cfloop list=#structKeyList(form)# index=field
cfset form[field] = CapFirst(Lcase(form[field]))/
/cfloop
This works great. Using Lower case becuase CapFirst converts to upper but
doesnt check for case in
www.cflib.orgthat's where I've found it in the past
Bryan Stevenson B.Comm.
VP Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]
- Original Message -
From: Wes
To: CF-Talk
Sent: Tuesday, July 20, 2004 2:10 PM
Subject: Proper Case
Here's one I use for some internal things.Nothing fancy, and never for any
world-visible formatting, so I don't know how perfect it will work,
particularly with edge cases.However, it should do most of the job for
you.
cffunction name=proper
cfargument name=s /
cfset var result = /
cfset s =
have you looked at www.cflib.org?hard to believe there's nothing there
that would fit your needs (?)
- Original Message -
From: Wes [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Tuesday, July 20, 2004 2:10 PM
Subject: Proper Case UDF
Does anyone have a handy CF Proper Case UDF
Does anyone have a handy CF Proper Case UDF they would like to share?I was
going to write one but thought I would check the web (without success) and a
few discussion forums first.
CFLib has one for title case (actually it title cases a list of elements), maybe you could start with that as a
Supposing I am getting an output of a query. If the
company name in the database is :
THE GOOD COMPANY INC
How do I convert it to:
The Good Company Inc
Appreciate
AB
I don't suppose you're using an Oracle DB, are you? That's as simple as
"SELECT INITCAP(foo) FROM bar"...
Other than that, I
Supposing I am getting an output of a query. If the
company name in the database is :
THE GOOD COMPANY INC
How do I convert it to:
The Good Company Inc
Search the Allaire Developers Exchange for the cf_capitalize custom tag. It
has an attribute you can set to Titlecase and works like a
10 matches
Mail list logo