To repeat the benjismith trick from a similar question , you can use an alternate character and replace it later:
String myString = "using `backticks` instead of quotes".replace('`', '"');
I was comfortable when I wrote tests using JSON
String json = "{`kind`:`file`,`sid`:802,`rid`:5678 ,`attrs`:{`name`:`FILE-WG-2468`}}".replace('`', '"'); // vs String json = "{\"kind\":\"file\",\"sid\":802,\"rid\":5678 ,\"attrs\":{\"name\":\"FILE-WG-2468\"}}";
jcadcell Oct 21 '16 at 16:51 2016-10-21 16:51
source share