inftech/cmd/stripColumns/strip.go
2017-03-08 20:15:10 +01:00

16 lines
230 B
Go

package main
func strip(str string) (output string) {
var (
start = 0
end = len(str)
)
for ; start < len(str) && str[start] == ' '; start++ {
}
for ; end > 0 && str[end-1] == ' '; end-- {
}
return str[start:end]
}