occurrence

package
v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL