func Contains(str string, substr string) bool https://pkg.go.dev/strings#Contains
These functions mirror the corresponding helpers in the standard strings package, but operate on raw bytes.
func Contains(str string, substr string) bool
func Index(str string, substr string) int64
func LastIndex(str string, substr string) int64
func IndexByte(str string, c byte) int64
func LastIndexByte(str string, c byte) int64
func IndexAny(str string, substr string) int64
func LastIndexAny(str string, substr string) int64
func Count(str string, substr string, overlap bool) int64Index / LastIndex return the byte offset of the first / last match, or -1 if absent. IndexByte / LastIndexByte do the same for a single byte. IndexAny / LastIndexAny find the first / last byte that belongs to the byte set substr; note this is byte-set based, not Unicode-rune based like strings.IndexAny. Count returns the number of matches, with overlap selecting overlapping versus non-overlapping counting; an empty substr yields 1 + len(str).
haystack := "the quick brown fox"
sz.Contains(haystack, "brown") // true
sz.Index(haystack, "brown") // 10
sz.LastIndexByte(haystack, 'o') // 17
sz.IndexAny(haystack, "aeiou") // 2
sz.Count(haystack, "o", false) // 2ContainsContains reports whether substr is within str.CountCount returns the number of overlapping or non-overlapping instances of substr in str.func Count(str string, substr string, overlap bool) int64 If substr is an empty string, returns 1 + the length of the str. https://pkg.go.dev/strings#Count
IndexIndex returns the index of the first instance of substr in str, or -1 if substr is not present.IndexAnyIndexAny returns the index of the first instance of any byte from substr in str, or -1 if none are present.func IndexAny(str string, substr string) int64 Note: This is byte-set based (ASCII/bytes), not Unicode rune semantics like strings.IndexAny. https://pkg.go.dev/strings#IndexAny
IndexByteIndexByte returns the index of the first instance of a byte in str, or -1 if a byte is not present.LastIndexLastIndex returns the index of the last instance of substr in str, or -1 if substr is not present.LastIndexAnyLastIndexAny returns the index of the last instance of any byte from substr in str, or -1 if none are present.func LastIndexAny(str string, substr string) int64 Note: This is byte-set based (ASCII/bytes), not Unicode rune semantics like strings.LastIndexAny. https://pkg.go.dev/strings#LastIndexAny
LastIndexByteLastIndexByte returns the index of the last instance of a byte in str, or -1 if a byte is not present.Utf8CountUtf8Count returns the number of Unicode codepoints in a UTF-8 string, SIMD-accelerated.func Utf8Count(str string) int It counts non-continuation bytes, the ones not matching the 10xxxxxx pattern, which agrees with utf8.RuneCount on well-formed UTF-8 but can differ on malformed input: for example, a run of lone continuation bytes counts as zero here, while utf8.RuneCount counts one per byte.