Documentation
¶
Index ¶
- Constants
- func Compare(a, b []byte) int
- func Count(b []byte, c byte) int
- func CountString(s string, c byte) int
- func Cutover(n int) int
- func Equal(a, b []byte) bool
- func Index(a, b []byte) int
- func IndexByte(b []byte, c byte) int
- func IndexByteString(s string, c byte) int
- func IndexString(str, sub string) int
Constants ¶
const ( MaxLen = int(-1) >> 31 MaxBruteForce = MaxLen )
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Compare two byte slices. Returns -1 if the first differing byte is lower in a, or 1 if the first differing byte is greater in b. If the byte slices are equal, returns 0. If the lengths are different and there are no differing bytes, compares based on length.
func CountString ¶
Count the number of instances of a byte in a string.
func Index ¶
Index finds the base index of the first instance of the byte sequence b in a. If a does not contain b, this returns -1.
func IndexByte ¶
Index finds the index of the first instance of the specified byte in the slice. If the byte is not found, this returns -1.
func IndexByteString ¶
Index finds the index of the first instance of the specified byte in the string. If the byte is not found, this returns -1.
func IndexString ¶
Index finds the base index of the first instance of a substring in a string. If the substring is not found, this returns -1.
Types ¶
This section is empty.