Golang net/textproto.TrimBytes() function example
package net/textproto
Golang net/textproto.TrimBytes() function usage example
package main
import (
"fmt"
"net/textproto"
)
func main() {
str := textproto.TrimBytes([]byte(" abc ")) // with space leading and trailing
fmt.Println(str) // without spaces
fmt.Println(string(str)) // without spaces
}
Reference :
Advertisement
Something interesting
Tutorials
+5.6k Golang : Detect words using using consecutive letters in a given string
+22.1k Golang : Repeat a character by multiple of x factor
+26.3k Golang : Calculate future date with time.Add() function
+17.9k Golang : How to make a file read only and set it to writable again?
+7.5k SSL : How to check if current certificate is sha1 or sha2 from command line
+27.9k Golang : Decode/unmarshal unknown JSON data type with map[string]interface
+6.8k Golang : Muxing with Martini example
+9k Golang : Build and compile multiple source files
+8.8k Golang : On lambda, anonymous, inline functions and function literals
+12.5k Golang : "https://" not allowed in import path
+13.6k Golang : Query string with space symbol %20 in between