Golang html/template.URLEscaper function example
package html/template
URLQueryEscaper returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query.
Golang html/template.URLEscaper function usage example
package main
import (
"fmt"
"html/template"
)
func main() {
search := "Zip Unzip"
finalURL := "http://go-search.org/search?q=" + template.URLQueryEscaper(search)
fmt.Println(finalURL)
}
Output :
http://go-search.org/search?q=Zip+Unzip
Reference :
Advertisement
Something interesting
Tutorials
+14.2k Golang : Chunk split or divide a string into smaller chunk example
+19.2k Golang : Check if directory exist and create if does not exist
+22.7k Golang : Strings to lowercase and uppercase example
+14.2k Golang : syscall.Socket example
+5k Python : Convert(cast) bytes to string example
+5.6k PHP : Convert CSV to JSON with YQL example
+12.3k Golang : Flush and close file created by os.Create and bufio.NewWriter example
+7.5k Golang : Create zip/ePub file without compression(use Store algorithm)
+11.4k Golang : Concatenate (combine) buffer data example
+16.9k Golang : Get the IPv4 and IPv6 addresses for a specific network interface
+19.7k Golang : Archive directory with tar and gzip
+27.7k PHP : Count number of JSON items/objects