I just wanted to say thank you for the sharp advise you provided to me more
than a week ago when I was in need.

-----Original Message-----
From: Ledwith, Brian [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 26, 2001 9:28 PM
To: CF-Community
Subject: RE: TRIM or REPLACE?


Tim,

Using trim is always a good idea for removing leading and trailing spaces,
especially from user provided data, but what you need here is to do one of
the following (there are few other ways...)

Either replace the "F-" with a "",
or do a "mid" starting after the "F-" to the end,
or grab the "right", starting after the "F-"


<cfset ExampleVariable="F-1a2b3c4d5e6f7g">

<cfoutput>
        Before:                 #ExampleVariable#<br>
        After "ReplaceNoCase":  #ReplaceNoCase(ExampleVariable,"F-", "",
"ALL")#<br>
        After "Mid":
#Mid(ExampleVariable,3,len(ExampleVariable)-2)#<br>
        After "Right":
#Right(ExampleVariable,len(ExampleVariable)-2)#
</cfoutput>


HTH,
~bgl
-----Original Message-----
From: Timothy Dineen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 26, 2001 9:13 PM
To: CF-Community
Subject: TRIM or REPLACE?


Hey everyone:

OK, On a good day I could do this, but this hasn't been a good day:

I need to take a variable and either TRIM it or REPLACE characters in it so
that I end up with the same variable I started with minus the first two
characters.

For example, I have a field in the database as "F-12345" and I need to drop
the "F-" portion.  The "12345" portion and be a random length or could
contain alphabetical characters, so I can't just RIGHT() the last five
numbers...

Combo of REPLACE and TRIM or is there a better method?
Any help is appreciated.

Thanks, Tim
Exposure.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to