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
+8.2k Android Studio : Rating bar example
+14.8k Golang : Get URI segments by number and assign as variable example
+10k Golang : Setting variable value with ldflags
+9.1k Golang : Intercept and compare HTTP response code example
+7.7k Golang : Mapping Iban to Dunging alphabets
+12.4k Golang : Encrypt and decrypt data with x509 crypto
+26k Golang : Convert IP address string to long ( unsigned 32-bit integer )
+43.2k Golang : Convert []byte to image
+12.7k Golang : Add ASCII art to command line application launching process
+8.7k Golang : How to join strings?
+5.7k Golang : ROT32768 (rotate by 0x80) UTF-8 strings example
+16.4k Golang : Convert slice to array