This commit is contained in:
Brian Hendriks
2019-05-08 13:44:20 -07:00
parent 58b8b928bd
commit 0a6610b74b
@@ -1,5 +1,7 @@
package strhelp
// NthToken returns the Nth token in s, delimited by delim. There is always at least one token: the zeroth token is the
// input string if delim doesn't occur in s. The second return value will be false if there is no Nth token.
func NthToken(s string, delim rune, n int) (string, bool) {
if n < 0 {
panic("invalid arguments.")