On Wed, Jun 25, 2008 at 1:49 PM, Robert Harrison [EMAIL PROTECTED]
wrote:
How do I indicate a comma in a replace list so I can replace the comma?
Example:
cfset new_var=#ReplaceList(trim(my_var), ##,,%,
,/,\,*,?,,,|,:,$,.,',,@,#chr(44)#,
_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)#
chr(44
Robert Harrison wrote:
How do I indicate a comma in a replace list so I can replace the comma?
Example:
cfset new_var=#ReplaceList(trim(my_var), ##,,%,
,/,\,*,?,,,|,:,$,.,',,@,#chr(44)#,
_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)#
chr(44) is the comma, but that doesn't work
How do I indicate a comma in a replace list so I can replace the comma?
replaceList is not the right tool for this, and since you are replacing
all characters by the same one,
what you need is REReplace. ie : REReplace (MyString,
[##%/\\*?|:$.'@,], _, all)
Example:
CFSET myString = a##aa
be either/or... It must be .
-Original Message-
From: Claude Schneegans [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2008 10:15 AM
To: CF-Talk
Subject: Re: Replace comma in replace list
How do I indicate a comma in a replace list so I can replace the comma?
replaceList is not the right
after playing with regex for 2 hours.
Not bad. The average is at leat 6 hours ;-)
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
: Re: Replace comma in replace list
You can't supply an alternate delimiter to replaceList, unfortunately,
so that won't work.
cheers,
barneyb
On Wed, Jun 25, 2008 at 3:05 PM, Bobby Hartsfield [EMAIL PROTECTED]
wrote:
Change your list delimiter so a comma isn't interpreted as a delimiter.
Check
How do I indicate a comma in a replace list so I can replace the comma?
Example:
cfset new_var=#ReplaceList(trim(my_var), ##,,%,
,/,\,*,?,,,|,:,$,.,',,@,#chr(44)#,
_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)#
chr(44) is the comma, but that doesn't work and neither does ,,.
Robert B
I think you have to do it separately. So do your replaceList for
everything except comma, and then follow it up with a replace for just
the comma.
cheers,
barneyb
On Wed, Jun 25, 2008 at 1:49 PM, Robert Harrison
[EMAIL PROTECTED] wrote:
How do I indicate a comma in a replace list so I can
: Wednesday, June 25, 2008 4:50 PM
To: CF-Talk
Subject: Replace comma in replace list
How do I indicate a comma in a replace list so I can replace the comma?
Example:
cfset new_var=#ReplaceList(trim(my_var), ##,,%,
,/,\,*,?,,,|,:,$,.,',,@,#chr(44)#,
_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)#
chr(44
You can't supply an alternate delimiter to replaceList, unfortunately,
so that won't work.
cheers,
barneyb
On Wed, Jun 25, 2008 at 3:05 PM, Bobby Hartsfield [EMAIL PROTECTED] wrote:
Change your list delimiter so a comma isn't interpreted as a delimiter.
Check out listChangeDelims() (or
10 matches
Mail list logo