Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coldfusion parsing through text...

Status
Not open for further replies.

ClarkKent101

Programmer
Jul 19, 2006
48
DE
Hi Everyone,

Does anyone know if there is a function in ColdFusion that will enable a person to parse a string of text? I've been browsing around some CFDocs and just haven't come across any sort of function or tag... other than parseDateTime() which i cant exactly use to do what i want to do.

My task at the moment is to parse a string of text sent from a textarea control on a form, for some reason when a user types in single quotes around some text within the textarea control it gets sent as double quotes... for example, i type in: 'hello' into the textarea, when the destination page receives the string, it receives it as "hello".. which isn't what i want. So i'm thinking if i could parse the 'hello' string and replace the double quotes that gets sent into single quotes that it would solve the problem. I suppose i could try doing this in JavaScript, i'm just wondering if i can do it in ColdFusion?

Thanks for your time,

- CK
 
Hi Wullie & ECAR,

Thank you both for your responses. The PreserveSingleQuotes() function is perfect to use in this case, thanks a bunch.

Solution i used:

Code:
<cfset myTextArea = FORM.textarea>

<cfoutput>#PreserveSingleQuotes(myTextArea)#</cfoutput>

Cheers guys,

- CK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top