comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Escaping Quotes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Escaping Quotes [message #44538 is a reply to message #44537] Mon, 20 June 2005 16:55 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Michael Wallace wrote:
> I am having a brain cramp right now and can't even remember the simplest
> of IDL. How do you escape quotes given that you want both single and
> double quotes to appear in the string?
>
> '"This string doesn't work"'
>
> Naturally, I tried using the standard slash-style escaping you find in
> other languages, but to no avail.

Doubtless there are many different ways to do it, using formatted
strings or byte<->string conversion or what-have-you, but the way that
seems simplest to my limited brain is to break the problem down into
substrings then recombine them:

IDL> print, '"This string mightn'+"'"+'t work, but it does!"'
"This string mightn't work, but it does!"


Ugly, though.

--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to calculate the curve area?
Next Topic: converting bytarr into strarr

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 12:28:38 PDT 2025

Total time taken to generate the page: 8.08113 seconds