Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Occurrence ¶
type Occurrence [2]int
Occurrence is a 2-integer array that represents the positions (beginning-end) of the substring in the string.
func Find ¶
func Find(s, sub string) []Occurrence
Find returns the positions of the substring in the string. If the string or the substring is empty, it returns nil.
func FindRegexp ¶
func FindRegexp(s, regex string) []Occurrence
FindRegexp is like Find, but it uses a regular expression to find the substring. If the string or the substring is empty, it returns nil.
Click to show internal directories.
Click to hide internal directories.