Golang encoding/xml.Escape() function example
package encoding/xml
Escape is like EscapeText but omits the error return value. It is provided for backwards compatibility with Go 1.0. Code targeting Go 1.1 or later should use EscapeText.
Golang encoding/xml.Escape() function usage example
package main
import (
"encoding/xml"
"os"
)
func main() {
str := "\"'&<>"
xml.Escape(os.Stdout, []byte(str))
}
Output :
" '&<>
Reference :
Advertisement
Something interesting
Tutorials
+13.6k Golang : Get user input until a command or receive a word to stop
+7.2k CloudFlare : Another way to get visitor's real IP address
+7.8k Golang : Load DSA public key from file example
+5.3k Golang : Generate Interleaved 2 inch by 5 inch barcode
+9.2k Golang : Generate Codabar
+12.8k Golang : Convert int(year) to time.Time type
+5.3k PHP : Hide PHP version information from curl
+9.7k Random number generation with crypto/rand in Go
+16.3k Golang : How to extract links from web page ?
+16.3k Golang : Loop each day of the current month example
+12.5k Golang : HTTP response JSON encoded data
+13.8k Generate salted password with OpenSSL example