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
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 easiest way is probably by using the ListFirst function like this:
newName = ListFirst(oldName, ".")
jay
-Original Message-
From: Chad Gray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 10:56 AM
To: CF-Talk
Subject: trim a string variable
Is t
AIL 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 i
: Chad Gray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 12: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
left(File.ServerFile,len(File.ServerFile)-4)
-Original Message-
From: Chad Gray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 12: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
TED]]
Sent: February 7, 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 lon
: 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
be to parse for the last period and return everything
before that. Return everything if there is no period.
- Original Message -
From: "Chad Gray" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Wednesday, February 07, 2001 11:55 AM
Subject: trim a string variab
correction, line 3:
CFSET newfilename = server.serverfilename
should read
CFSET newfilename = file.serverfilename
sry...
Terry Bader
IT/Web Specialist
EDO Corp - Combat Systems
(757) 424-1004 ext 361 - Work
[EMAIL PROTECTED]
(757)581-5981
uary 07, 2001 12: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 long
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 t
Try
cfset filename = "file.jpg"
cfset newfilename = spanexcluding(filename,".")
-Original Message-
From: Phoeun Pha [mailto:[EMAIL PROTECTED]]
Sent: 07 February 2001 20:26
To: CF-Talk
Subject: RE: trim a string variable
Left(var,Len(var)-4)
Let's say var =
: 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
, you could say
cfset newfilename = ListFirst(File.ServerFile,".")
Note that you don't need the # signs inside the CFSET tag.
Bob
-Original Message-
From: Chad Gray [mailto:[EMAIL PROTECTED]]
Sent: February 7, 2001 1:56 PM
To: CF-Talk
Subject: trim a string variable
Is t
]]
Sent: Wednesday, February 07, 2001 3:42 PM
To: CF-Talk
Subject: RE: trim a string variable
Look at the List functions within ColdFusion - they are extremely useful.
In your example, you could say
cfset newfilename = ListFirst(File.ServerFile,".")
Note that you don't need the # si
i was actually going to suggest this. the only problem is if the
file name
is something like filename.old.cfm or something like that.
So then you can do this:
cfset newname = Reverse(ListRest(Reverse(filename), "."))
That will handle almost anything. As long as you know you want to
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
You can do it this way
CFSET newfilename=left(File.ServerFile,(len(File.ServerFile)-4))
Allan Pichler
-Original Message-
From: Chad Gray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 10:56 AM
To: CF-Talk
Subject: trim a string variable
Is there a way to trim a string
ED]]
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 co
20 matches
Mail list logo