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
+20.2k Golang : Count number of digits from given integer value
+18k Golang : How to log each HTTP request to your web server?
+7.4k Golang : Accessing dataframe-go element by row, column and name example
+12.4k Elastic Search : Return all records (higher than default 10)
+13.1k Golang : Convert(cast) uintptr to string example
+14.6k Golang : GUI with Qt and OpenCV to capture image from camera
+10.1k Golang : Identifying Golang HTTP client request
+7.6k Golang : Set horizontal, vertical scroll bars policies and disable interaction on Qt image
+17.7k How to enable MariaDB/MySQL logs ?
+5.4k Javascript : How to loop over and parse JSON data?
+16.3k Golang : convert string or integer to big.Int type
+7.8k Golang : Load DSA public key from file example