zstring

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cut

func Cut(val string, separator string) (left, right string, found bool)

Cut a string where a separator occurs

func CutAny

func CutAny(val string, seperators ...string) (left, right string, found bool)

Cut the string where the first occurence of a separator occurs

func CutOut

func CutOut(val, leftBound, rightBound string) (remaining string, found bool)

Extract the part of a string surrounded by two separators

func CutOutAny

func CutOutAny(val string, leftBounds []string, rightBounds []string) (remaining string, found bool)

Extract the part of a string surrounded by multiple sets of separators

func ReplaceManyWithOne added in v0.3.0

func ReplaceManyWithOne(val string, needles []string, replacement string) string

Like ReplaceAll, but for replacing several sequences at once

func TrimPrefixes added in v0.3.0

func TrimPrefixes(val string, prefixes ...string) string

Like TrimPrefix, but for removing several prefixes at the same time

func TrimSuffixes added in v0.3.0

func TrimSuffixes(val string, suffixes ...string) string

Like TrimSuffix, but for removing several suffixes at the same time

Types

This section is empty.

Jump to

Keyboard shortcuts

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