function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kabukabu 

Escape double quote and backslash from a Json string

I am looking for code to escape double quote and backslash.
String val='my "test" \string';
after escape it should display
my "test" \string

thanks in advance.
Nidhi L SharmaNidhi L Sharma
Hi Kabu,

On adding escape character  before special characters would resolve your issue.

String val='my \"test\" \\string';

Hope it helps you.
 
kabukabu
I have a string like
{"a":"123", "b":" why my code not working, what is the error's"}
a="123"
b="why my code not working, what is the error's"
I am getting error on Parsing Invalid Character