Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Remove double quote from each string in list

Posted on 2006-11-13
5
Medium Priority
?
2,409 Views
Last Modified: 2013-12-24
I have a comma-delimited list that have a double quote after each string such as peter", paul", mary"  How can I remove the double quote from each string, then recreate the list?
0
Comment
Question by:COwebmaster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 1

Expert Comment

by:coderWil
ID: 17933226
The code below assumes that 'xx' is your variable name that carries the value list.  for your code, change it to your variable name.

What it does:  It replaces all double-quote comma occurances with only a comma  and then it checks to see if there is a 'trailing' double quote and removes it completely.

<cfset xx = replace(xx, """,","""")>
<cfif right(xx, 1) = """">
  <cfset xx = left(xx, len(xx) - 1)>
</cfif>
0
 

Author Comment

by:COwebmaster
ID: 17933406
Ok, let me try that..
0
 

Author Comment

by:COwebmaster
ID: 17933518
Didn't work.  Again, what I have is already a comma delimited string:

peter", paul", mary"

I just need to remove the quotes at the end of each name so it's:

peter, paul, mary
0
 
LVL 39

Accepted Solution

by:
gdemaria earned 2000 total points
ID: 17933530

 a list is just a string as well, this should work
 <cfset variables.mystring = replace(variables.mystring,'"','','all')>

 (note that the 2nd parameter is   '  "   '    (but without spaces)  
0
 

Author Comment

by:COwebmaster
ID: 17933614
Perfect, thanks!
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question