Golang Escape Double Quoted String Easily
Clavin June

Clavin June @clavinjune

About: a bunch of perceptrons

Location:
Jakarta, Indonesia
Joined:
Oct 5, 2018

Golang Escape Double Quoted String Easily

Publish Date: May 22 '22
2 0

Sunday Snippet #18 golang escape double quoted string easily

main.go

package main

import . "fmt"

func main() {
    Printf("%q", `"foobar"`)
}
Enter fullscreen mode Exit fullscreen mode

run go

$ go run main.go
"\"foobar\""

Enter fullscreen mode Exit fullscreen mode

Comments 0 total

    Add comment