On Monday, 15 February 2016 at 14:09:04 UTC, tcak wrote:
Other than generating normal JSON content (stringify), JSON
string is used for Javascript string expressions as well.
To create a properly encoded Javascript string, the shortest
way is
JSONValue("this'\\is//the\"text").toString();
Other than generating normal JSON content (stringify), JSON
string is used for Javascript string expressions as well.
To create a properly encoded Javascript string, the shortest way
is
JSONValue("this'\\is//the\"text").toString();
Yes, it works, but it is uncomfortable to write the code as