Golang strconv.AppendQuoteRune() and AppendQuoteRuneToASCII() functions example
package strconv
Golang strconv.AppendQuoteRune() and AppendQuoteRuneToASCII() functions usage example
package main
import (
"fmt"
"strconv"
)
func main() {
//func AppendQuoteRune(dst []byte, r rune) []byte
dst := []byte("String is ")
fmt.Println("Before : ", string(dst))
b := strconv.AppendQuoteRune(dst, 't') // replace double quote with single quote for rune
fmt.Println("After : ", string(b))
b = strconv.AppendQuoteRuneToASCII(dst, '다')
fmt.Println("After : ", string(b))
}
References :
Advertisement
Something interesting
Tutorials
+15.6k Chrome : ERR_INSECURE_RESPONSE and allow Chrome browser to load insecure content
+14.4k Golang : Parsing or breaking down URL
+20.7k Android Studio : AlertDialog and EditText to get user string input example
+11.7k Golang : How to detect a server/machine network interface capabilities?
+5k Golang : Calculate a pip value and distance to target profit example
+22.7k Golang : Set and Get HTTP request headers example
+5.2k Python : Create Whois client or function example
+10.3k Golang : Convert file unix timestamp to UTC time example
+10.8k PHP : Convert(cast) bigInt to string
+23.1k Golang : Randomly pick an item from a slice/array example
+6.9k How to let Facebook Login button redirect to a particular URL ?
+6.7k Golang : Experimental emojis or emoticons icons programming language