resource-scraper/helper/sugar/string.go

9 lines
212 B
Go

package sugar
import "regexp"
// SqueezeLine remove extra spaces and line breaks from a string
func SqueezeLine(line string) string {
return regexp.MustCompile(`(?m)[\n\r\t\s]+`).ReplaceAllString(line, " ")
}