Filtering out quotes

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
arkstar
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 70
Joined: Mon Dec 21, 2009 1:51 am

Filtering out quotes

Post by arkstar » Thu Feb 20, 2014 2:22 pm

I've been reading other posts, but none of the solutions seem to work.
I have a variable myVar="blah blah blah"
I want to remove the quotes so when I put the value into a field it is blah blah blah.

I've tried 'filter myVar without quote' & the replace command.
Does anyone have an idea?

Thanks!!!
Rob Glassman
ArkStar

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Filtering out quotes

Post by LCNeil » Thu Feb 20, 2014 2:30 pm

Hi Arkstar,

Something like the following script should allow you do strip the quotes from your variable

delete char 1 of myVar
delete char -1 of myVar
Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
-

Klaus
Posts: 14208
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Filtering out quotes

Post by Klaus » Thu Feb 20, 2014 2:50 pm

Hi Robert,

hmm:
...
replace QUOTE with "" in myVar
...
works here for me!?

Code: Select all

on mouseUp
  put QUOTE & "text" & QUOTE into tVar
  put tVar into tVar2
  replace QUOTE with "" in tVar2
  put tVar & CR & tvar2
end mouseUp
Gives me this in the message box:
"text"
text


Best

Klaus

arkstar
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 70
Joined: Mon Dec 21, 2009 1:51 am

Re: Filtering out quotes

Post by arkstar » Fri Feb 21, 2014 9:08 am

Thank you Neil & Klaus!

Best,
Rob
Rob Glassman
ArkStar

Post Reply