-Original Message-
From: Bruce Sorge [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 24, 2007 3:21 PM
Subject: Trouble with RIGHT function
3, 4, 5, 6,
When I do this:
cfset URL.Group = REPLACE(URL.GROUPS, RIGHT(URL.GROUPS, 1),'')
I get 3 4, 5, 6,
Does this produce the same
Actually that did the trick. Thanks.
Does this produce the same error:
mid(url.groups, 1, Len(url.groups)-1))
Damien McKenna
Web Developer
The LIMU Company
Making a Difference
610 Crescent Executive Court, Suite 110
Lake Mary, FL 32746
P 407.548.3800
F 407.333.0419
The way you're using right() and replace() is incorrect.
RIGHT(URL.GROUPS, 1) will return the last character in the string. In this
case, a comma.
Then with replace(), you're using the result of right() (the comma) and
replacing the first instance (and only the first, since you didn't specify
cfset URL.Group = REPLACE(URL.GROUPS, RIGHT(URL.GROUPS, 1),'')
Yeah, you don't want REPLACE there, it's doing exactly what you're telling
it: replace the first comma with an empty string.
You could do what Damien suggested or also Left(url.groups,
len(url.groups)-1)
-- Josh
cfset URL.Group = REPLACE(URL.GROUPS, RIGHT(URL.GROUPS, 1),'')
Bruce-
Looks like that code's telling CF to replace the first occurrence of
right(url.groups,1), which is a comma. So your results are that the
first comma in your string is being replaced. I suspect what you
actually want is to
5 matches
Mail list logo