Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 396
  • Last Modified:

Test a string with Quote Marks in it

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
RickEpnet
Asked:
RickEpnet
  • 2
1 Solution
 
coldfusionwebdevCommented:
Try this:

<cfif form.My_Text contains "<embed" and form.My_Text does not contains '<param name="wmode" value="transparent">'>
0
 
RickEpnetAuthor Commented:
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
 
coldfusionwebdevCommented:
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
 
Kevin CrossChief Technology OfficerCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now