Golang net/textproto.TrimString() function example
package net/textproto
Golang net/textproto.TrimString() function usage example
package main
import (
"fmt"
"net/textproto"
)
func main() {
str := textproto.TrimString(" abc ") // with space leading and trailing
fmt.Println(str) // without spaces
fmt.Println(string(str)) // without spaces
}
Reference :
Advertisement
Something interesting
Tutorials
+22.4k Golang : How to read JPG(JPEG), GIF and PNG files ?
+5.3k Python : Convert(cast) string to bytes example
+9.3k Golang : Generate EAN barcode
+14.6k Golang : Send email with attachment(RFC2822) using Gmail API example
+14.8k Golang : Normalize unicode strings for comparison purpose
+10.8k Android Studio : Checkbox for user to select options example
+5.4k Golang *File points to a file or directory ?
+35.1k Golang : Upload and download file to/from AWS S3
+5.8k CodeIgniter/PHP : Remove empty lines above RSS or ATOM xml tag
+9.7k Golang : Load ASN1 encoded DSA public key PEM file example
+14.4k Golang : How to filter a map's elements for faster lookup