Golang net/url.QueryUnescape() function example
package net/url
Golang net/url.QueryUnescape() function usage example
package main
import (
"fmt"
"net/url"
)
func main() {
str, err := url.QueryUnescape("http://jonna:p%40ssword@example.com")
if err != nil {
panic(err)
}
fmt.Println("After unescaped : ", str)
hex, err := url.QueryUnescape("%40")
if err != nil {
panic(err)
}
fmt.Println(hex)
}
Output :
After unescaped : http://jonna:p@ssword@example.com
@
Reference :
Advertisement
Something interesting
Tutorials
+25.4k Golang : Convert long hexadecimal with strconv.ParseUint example
+12.3k Golang : Flush and close file created by os.Create and bufio.NewWriter example
+9.5k Golang : Accessing content anonymously with Tor
+7k Golang : Find the shortest line of text example
+7.3k Golang : How to iterate a slice without using for loop?
+4.8k Javascript : How to get width and height of a div?
+11.3k Golang : Characters limiter example
+24.5k Golang : GORM read from database example
+22.8k Golang : untar or extract tar ball archive example
+17k Golang : Get number of CPU cores
+30.9k Golang : Interpolating or substituting variables in string examples
+22.1k Golang : Print leading(padding) zero or spaces in fmt.Printf?