Re: [go-nuts] Function to escape and unscape string

2021-08-29 Thread Christopher Puschmann
Hi, have you tried fmt.Sscanf? https://play.golang.org/p/Ebr9VcobOcE On 29.08.2021 21:52, 'nadashin' via golang-nuts wrote: > fmt.Printf has a format specifier, %q that escapes string with Go syntax and > add quotes around the string. ( %#v also does it) But it doesn't have one > that unesca

Re: [go-nuts] Function to escape and unscape string

2021-08-29 Thread jake...@gmail.com
https://pkg.go.dev/strconv#Unquote seems to be what you are describing. Perhaps you could explain *how *it fails to do what you want. Maybe a playground example? On Sunday, August 29, 2021 at 3:53:02 PM UTC-4 nadashin wrote: > > > fmt.Printf has a format specifier,

Re: [go-nuts] Function to escape and unscape string

2021-08-29 Thread 'nadashin' via golang-nuts
> > fmt.Printf has a format specifier, %q that escapes string with Go > > syntax and add quotes around the string. ( %#v also does it) > > > > But it doesn't have one that unescapes a string. > > > > I couldn't find any stdlib function that escape and unescape a string > > following Go syntax. (and

Re: [go-nuts] Function to escape and unscape string

2021-08-29 Thread Jan Mercl
On Sun, Aug 29, 2021 at 9:02 PM 'nadashin' via golang-nuts wrote: > fmt.Printf has a format specifier, %q that escapes string with Go > syntax and add quotes around the string. ( %#v also does it) > > But it doesn't have one that unescapes a string. > > I couldn't find any stdlib function that es