strings2

package
v1.5.14 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LeftBlocks                     = []string{"{", "[", "("}
	RightBlocks                    = []string{"}", "]", ")"}
	DefaultSplitBlock SplitSetting = func(s *SplitConfig) {
		s.LeftSkipCharacters = LeftBlocks
		s.RightSkipCharacters = RightBlocks
	}
)

Functions

func Index

func Index(s, sep string, left, right []string) int

func IndexSkipBlocks

func IndexSkipBlocks(s, sep string) int

func Split

func Split(val, sep string, ops ...SplitSetting) []string

func SplitN

func SplitN(val, sep string, n int, ops ...SplitSetting) []string

func SplitWithConfig

func SplitWithConfig(s string, config *SplitConfig) []string

Types

type SplitConfig

type SplitConfig struct {
	Sep                 string
	After               bool
	N                   int
	LeftSkipCharacters  []string
	RightSkipCharacters []string
}

type SplitSetting

type SplitSetting func(s *SplitConfig)

Jump to

Keyboard shortcuts

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