Or:

<cfset variable="Some text to convert here">

<cfset newword="">
<cfloop list="#variable# index=word delimiter=" ">
        <cfset newword=ListAppend(newword, UCase(Left(word, 1)) & Right(word,
Len(word)-1), " ")>
</cfloop>

Steve

> -----Original Message-----
> From: Jeff Bevill [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 26, 2000 14:50
> To: CF-Talk
> Subject: RE: Capitalize First Letter of Each Word
>
>
> John McKown,
>
> Here ya go man.  I only had about 10 mins to write this, hope it works. :)
>
> <!--- l33t w3rd fixer v1.0 --->
> <!--- Jeff Bevill - [EMAIL PROTECTED] --->
>
> <cfset Variable="UnBeLiEvAbLe">
>
> <cfif isDefined("Variable") and Len(Variable) GT 0>
>       <cfset in="1">
>       <cfset out="0">
>       <cfset word_state=out>
>
>       <cfset NewStr="">
>       <cfset is_space=false>
>       <cfloop index=i from=1 to=#Len(Variable)#>
>               <cfset Character=Mid(Variable, i, 1)>
>
>               <cfif Character is " ">
>                       <cfset word_state=out>
>                       <cfset NewStr=NewStr & Character>
>               <cfelseif Asc(Character) GE Asc("a") and
> Asc(Character) LE Asc("z") and
> word_state EQ out>
>                       <cfset word_state=in>
>                       <cfset NewStr=NewStr & UCase(Character)>
>               <cfelseif Asc(Character) GE Asc("A") and
> Asc(Character) LE Asc("Z") and
> word_state EQ in>
>                       <cfset NewStr=NewStr & LCase(Character)>
>               <cfelse>
>                       <cfset word_state=in>
>                       <cfset NewStr=NewStr & Character>
>               </cfif>
>
>       </cfloop>
>
>       <cfset Variable=NewStr>
> </cfif>
>
> <cfoutput>#Variable#</cfoutput>
>
> Jeff Bevill
>
> -----Original Message-----
> From: John McKown [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 26, 2000 6:35 AM
> To: CF-Talk
> Subject: Capitalize First Letter of Each Word
>
>
> Can someone share a script that will capitalize the
> first letter of every word entered into a form field?
>
> John McKown, VP Business Services
> Delaware.Net, Inc.
> 30 Old Rudnick Lane, Suite 200 Dover, DE 19901
> email: [EMAIL PROTECTED]
> phone: 302-736-5515
> fax: 302-736-5945
> icq: 1495432
>
>
>
> ------------------------------------------------------------------
> ----------
> --------------------
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
> or send a
> message with 'unsubscribe' in the body to
> [EMAIL PROTECTED]
>
> ------------------------------------------------------------------
> ------------------------------
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
> or send a message with 'unsubscribe' in the body to
> [EMAIL PROTECTED]
>

------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to