551
Views
3
Comments
Solved
Double quotes in string

Hi, 

I need to be able to save this text "Rules=[{"type": "include", "all": "true"}]" in a text var but I'm having problems with the double quotes. What's the best way to do this?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

What kind of problem do you have with the double quotes? You mean you want a string literal with that text? In that case you need to type two double quotes for every double quote literal. So:

"Rules=[{""type"": ""include"", ""all"": ""true""}]"

That will create a Text with content

Rules=[{"type": "include", "all": "true"}] 


2019-06-18 18-34-57
André Vieira

@Kilian Hekhuis it's exactly that. Before posting, I tried that way but using the debugger it was not showing the correct values. Printing that value to an expression solved my test issue :) Thanks!

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Great you got it solved. The debugger should display the same value as you need to enter, so with double double quotes for every actual single double quote.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.