Home | History | Annotate | Download | only in bytes

Lines Matching refs:sep

9 // Index returns the index of the first instance of sep in s, or -1 if sep is not present in s.
10 func Index(s, sep []byte) int {
11 n := len(sep)
16 return IndexByte(s, sep[0])
18 if Equal(sep, s) {
25 c := sep[0]
37 if Equal(s[i:i+n], sep) {
47 // TODO: if large prefixes of sep are matching
51 j := indexRabinKarp(s[i:], sep)
61 // Count counts the number of non-overlapping instances of sep in s.
62 // If sep is an empty slice, Count returns 1 + the number of UTF-8-encoded code points in s.
63 func Count(s, sep []byte) int {
64 if len(sep) == 1 {
65 return countByte(s, sep[0])
67 return countGeneric(s, sep)