<cfset newfilename = #left(File.ServerFile,(LEN(File.ServerFile)-4))#>
should work, however remember that not all files have just a 3 letter ext.
you might want to just use <CFSET newfilename = server.serverfilename>
serverfilename is the file without ext and period...
another long way is to grab the ext before moving the file around, then
remove LEN(ext)+1 from the right...
Terry Bader
IT/Web Specialist
EDO Corp - Combat Systems
(757) 424-1004 ext 361 - Work
[EMAIL PROTECTED]
(757)581-5981 - Mobile
[EMAIL PROTECTED]
icq: 5202487 aim: lv2bounce
http://www.cs.odu.edu/~bader
-----Original Message-----
From: Chad Gray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 1:56 PM
To: CF-Talk
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