Re: [go-nuts] strings: escape sequence translation

2021-09-07 Thread 'nadashin' via golang-nuts
On Tuesday, September 7th, 2021 at 20:05, Jan Mercl <0xj...@gmail.com> wrote: > On Tue, Sep 7, 2021 at 4:40 AM 'nadashin' via golang-nuts > > golang-nuts@googlegroups.com wrote: > > > Why is the function in Go compiler that interprets escape sequences not >

Re: [go-nuts] strings: escape sequence translation

2021-09-07 Thread &#x27;nadashin&#x27; via golang-nuts
On Tuesday, September 7th, 2021 at 08:55, Kurtis Rader wrote: > It does. See https://pkg.go.dev/strconv#Unquote. Try this hastily thrown > together example: > > package main > > import ( > "fmt" > "strconv" > ) > > func main() { > e := strconv.Quote("a\033\r\nb") > v, er

[go-nuts] strings: escape sequence translation

2021-09-06 Thread &#x27;nadashin&#x27; via golang-nuts
Why is the function in Go compiler that interprets escape sequences not available in Go's standard library? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang

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

2021-08-29 Thread &#x27;nadashin&#x27; 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

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

2021-08-29 Thread &#x27;nadashin&#x27; via golang-nuts
> I couldn't find any stdlib function that escape and unescape a string > following Go syntax. (and doesn't add quotes around the string) If the stdlib doesn't have such functions I am proposing to add them. -- You received this message because you are subscribed to the Google Groups "golang-nu

[go-nuts] Function to escape and unscape string

2021-08-29 Thread &#x27;nadashin&#x27; 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 doesn't add quotes around

[go-nuts] parameter type of strings.NewReplacer

2021-07-05 Thread &#x27;nadashin&#x27; via golang-nuts
What is the purpose of having, func NewReplacer(oldnew ...string) *Replacer instead of, func NewReplacer(oldnew ...[2]string) *Replacer -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving email