Replace Quotes with Escaped Quotes in String

Peter TB Brett peter.brett at livecode.com
Mon Dec 14 11:44:14 EST 2015



On 14/12/2015 15:50, Brahmanathaswami wrote:
> Are single quotes and double quotes equivalent in Livecode?
>
> that would be new, i don't think soS
>
> Single quotes do not work
>

No, single quotes and double quotes are not equivalent in LiveCode. 
However, the shell ignores any escape characters or " characters inside 
single-quoted strings.

So, you can do:

replace "'" with "\'" in tBody
put merge("echo '[[tBody]]' | ") into tCmd

and your tBody should be protected from shell expansion.

                                     Peter

-- 
Dr Peter Brett <peter.brett at livecode.com>
LiveCode Open Source Team

LiveCode on reddit: https://reddit.com/r/livecode




More information about the Use-livecode mailing list