Golang strconv.AppendQuote() function example
package strconv
Golang strconv.AppendQuote() function usage example.
package main
import (
"fmt"
"strconv"
)
func main() {
//func AppendQuote(dst []byte, s string) []byte
dst := []byte("String is ")
fmt.Println("Before : ", string(dst))
b := strconv.AppendQuote(dst, "this")
fmt.Println("After : ", string(b))
b = strconv.AppendQuote(dst, "that")
fmt.Println("After : ", string(b))
}
Output :
Before : String is
After : String is "this"
After : String is "that"
Reference :
Advertisement
Something interesting
Tutorials
+14.9k Golang : Get IP addresses of a domain name
+7.4k Golang : Generate Datamatrix barcode
+23.4k Golang : Change file read or write permission example
+10.3k Golang : Generate DSA private, public key and PEM files example
+6.5k Golang : What fmt.Println() can do and println() cannot do
+9.7k Golang : Fix - does not implement sort.Interface (missing Len method)
+4.2k Golang : Pad file extension automagically
+6.2k Golang : Gorrila mux.Vars() function example
+6.3k Golang : Check to see if *File is a file or directory
+7.1k Golang : Variadic function arguments sanity check example
+4.1k Golang : micron to centimeter example