12 lines
158 B
Go
12 lines
158 B
Go
package util
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
func SplitN(text string, n int) []string {
|
|
re := regexp.MustCompile(`\s+`)
|
|
tokens := re.Split(text, n)
|
|
return tokens
|
|
}
|