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.4k Golang : Find network of an IP address
+7.6k Javascript : Push notifications to browser with Push.js
+10.1k Golang : Get login name from environment and prompt for password
+6.8k Golang : Muxing with Martini example
+19.3k Golang : Get host name or domain name from IP address
+48.1k Golang : How to convert JSON string to map and slice
+19.1k Mac OSX : Homebrew and Golang
+10.9k Golang : Sieve of Eratosthenes algorithm
+14.5k Golang : How to check if your program is running in a terminal
+31.7k Golang : How to convert(cast) string to IP address?
+19.9k Golang : How to get time from unix nano example
+14.5k Golang : Rename directory