inftech/cmd/stripColumns/strip.go

16 lines
230 B
Go
Raw Permalink Normal View History

2017-03-08 20:15:10 +01:00
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]
}