-2

I have the below data which I want to make as String and I want to keep all spacial character as it is:

, ref : "[REF]", r: "[INSERT_CLICK_TAG]"});

This what I tried but it is giving an error:

String data=", ref : "[REF]",  r: "[INSERT_CLICK_TAG]"});";

How can I make this data into string variable?

Duncan Jones
  • 63,838
  • 26
  • 184
  • 242
Aadi
  • 1,111
  • 1
  • 15
  • 29

1 Answers1

3

You can create as follows:

String data=", ref : \"[REF]\",  r: \"[INSERT_CLICK_TAG]\"});";
Mithun
  • 7,297
  • 6
  • 48
  • 64