AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

CS Removing ” from a variable string   - quotation marks
 
 

I have tripped over this twice and I am not sure how to solve it.
I have a $variable that contains ” or quotation marks within in it.
I would like to remove the marks.
I tried writing an outputmacro, but it does not seem to work.

outputmacro: ^removejson4(^text)
^substitute(character ^text ‘“’ ‘’ )

Is there another way to remove quotation marks from a string?

I am adding strings before and after the current ^response(x) string, and it shows up as
as

added stuff “Hi, how are you” added stuff
and i want it to put out
added stuff Hi, how are you added stuff

would appreciate any breadcrumbs

 

 
  [ # 1 ]

^substitute(character $_text \” “”)

but that removes even quotes within the string which you may not want.
You can also ^extract the first character and if it is a “, extract the rest and extract without the closing quote

 

 
  [ # 2 ]

Ah, that works!  Thank you very much.
It reminds me of SED

All of my dialogue is spoken / read outloud, so I don’t plan on using quotes to surround words.
Thank you again.

 

 
  [ # 3 ]

Just noting that I modified it slightly, to read
^substitute(character ^text \” “”)

 

 
  login or register to react