Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Test a string with Quote Marks in it

Posted on 2010-08-13
4
Medium Priority
?
393 Views
Last Modified: 2013-12-24
How do you test a string that has quote mark in it. See code?
<cfif form.My_Text contains "<embed" and form.My_Text does not contains "<param name="wmode" value="transparent">">

Open in new window

0
Comment
Question by:RickEpnet
  • 2
4 Comments
 
LVL 1

Expert Comment

by:coldfusionwebdev
ID: 33434632
Try this:

<cfif form.My_Text contains "<embed" and form.My_Text does not contains '<param name="wmode" value="transparent">'>
0
 
LVL 14

Author Comment

by:RickEpnet
ID: 33434681
I had already tried that.

I get this error.
       Invalid CFML construct found on line 96 at column 93. ColdFusion was looking at the following text:' The CFML compiler was processing: A cfif tag beginning on line 96, column 10. A cfif tag beginning on line 96, column 10. The error occurred on line -1.
   
0
 
LVL 1

Accepted Solution

by:
coldfusionwebdev earned 2000 total points
ID: 33434721
Sorry, take out contains and replace that with contain like this:
<cfif form.My_Text contains "<embed" and form.My_Text does not contain '<param name="wmode" value="transparent">'>
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 33437053
Note also you can escape quotes by using two.

i.e., ""

The use of single quotes on the outside should be easier though as you don't have to change the original string.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
What You Need to Know when Searching for a Webhost Provider
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

972 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