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 = lcase(s) />
<cfloop list="#s#" index="i" delimiters=" #chr(9)#">
<cfset result = listAppend(result, ucase(left(i, 1)) &
removeChars(i, 1, 1), " ") />
</cfloop>
<cfreturn result />
</cffunction>
Cheers,
barneyb
> -----Original Message-----
> From: Wes [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 20, 2004 2:10 PM
> To: CF-Talk
> Subject: 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.
>
>
>
> Basically, my application sometimes has users entering in
> data in ALL CAPS.
> DON'T YOU HATE IT WHEN THEY DO THAT?!! So, I want to run the content
> through a ProperCase() function that will format it properly before
> inserting that data into the database.
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

