<cfset newfilename = #mid(File.ServerFile,1, len(File.ServerFile)-4)#>

This just truncates the last 4 characters off the end, obviously won't work
if the extension is longer than 3 characters.

Robert
-------
In the real world
as in dreams
nothing is quite
what it seems.
- Dean R. Koontz, The Book of Counted Sorrows


----- Original Message -----
From: "Chad Gray" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 1:55 PM
Subject: trim a string variable


> Is there a way to trim a string like : file.jpg
> to  : file
> (aka knock off the last 4 characters)
>
> <cfset newfilename = #left(File.ServerFile,4)#>  Does not work because the
> name of the file in the database could be longer then 4 characters
>
> Is there a function that im missing to trim off the last 4 characters of a
> variable?
>
> Thanks
> Chad
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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