gjson icon indicating copy to clipboard operation
gjson copied to clipboard

Has a way to escape all character?

Open itmaple opened this issue 2 years ago • 4 comments

I have a string x.x.x, if escape , I need to change it to x\.x\.x. I think it can escape all character like this $x.x.x$ sjson can also support this syntax.

itmaple avatar Nov 20 '21 19:11 itmaple

You can see information on escape characters for gjson here: https://github.com/tidwall/gjson/blob/master/SYNTAX.md#escape-character

goshlanguage avatar Dec 06 '21 20:12 goshlanguage

Only one character escape. Sometime I need a raw string.

itmaple avatar Dec 15 '21 09:12 itmaple

Perhaps having a utility function, like EscapePath might be useful?

tidwall avatar Dec 15 '21 13:12 tidwall

Like this, or a modifier @raw:""

itmaple avatar Dec 17 '21 02:12 itmaple