Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Split slices s into all substrings separated by sep and
- // returns a slice of the substrings between those separators.
- func Split(s, sep string) []string {
- var result []string
- i := strings.Index(s, sep)
- for i > -1 {
- result = append(result, s[:i])
- s = s[i+len(sep):]
- i = strings.Index(s, sep)
- }
- return append(result, s)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement