Lines Matching full:substr
76 func countGeneric(s, substr string) int {
78 if len(substr) == 0 {
83 i := Index(s, substr)
88 s = s[i+len(substr):]
92 // Contains reports whether substr is within s.
93 func Contains(s, substr string) bool {
94 return Index(s, substr) >= 0
107 // LastIndex returns the index of the last instance of substr in s, or -1 if substr is not present in s.
108 func LastIndex(s, substr string) int {
109 n := len(substr)
114 return LastIndexByte(s, substr[0])
116 if substr == s {
124 hashss, pow := hashStrRev(substr)
130 if h == hashss && s[last:] == substr {
137 if h == hashss && s[i:i+n] == substr {
930 func indexRabinKarp(s, substr string) int {
932 hashss, pow := hashStr(substr)
933 n := len(substr)
938 if h == hashss && s[:n] == substr {
946 if h == hashss && s[i-n:i] == substr {