Home | History | Annotate | Download | only in strings

Lines Matching refs:substr

12 // Index returns the index of the first instance of substr in s, or -1 if substr is not present in s.
13 func Index(s, substr string) int {
14 n := len(substr)
19 return IndexByte(s, substr[0])
21 if substr == s {
28 c := substr[0]
40 if s[i:i+n] == substr {
47 j := indexRabinKarp(s[i:], substr)
57 // Count counts the number of non-overlapping instances of substr in s.
58 // If substr is an empty string, Count returns 1 + the number of Unicode code points in s.
59 func Count(s, substr string) int {
60 return countGeneric(s, substr)