Hello Reader,
I am working on function to remove the whitespace from begginning and ending of string
https://play.golang.org/p/n6lIkLHlZl6
package Madhur
// This package will alter the user name if there are white spaces in name of string
// this will remove the white spaces (if any) from string
func Remove_Whitespc(word string) string {
// str is converted to byte a string are immutable
str := []byte(word)
if str[0] == ' '{
for i := 0; i < len(str) - 1; i++ {
str[i] = str[i+1]
}
}
return string(str)
}