Mirror of github.com/gissleh/irc
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
389 B

package ircutil
import (
"strings"
)
// ParseArgAndText parses a text like "#Channel stuff and things" into "#Channel"
// and "stuff and things". This is commonly used for input commands which has
// no standard
func ParseArgAndText(s string) (arg, text string) {
spaceIndex := strings.Index(s, " ")
if spaceIndex == -1 {
return s, ""
}
return s[:spaceIndex], s[spaceIndex+1:]
}