zstring

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelToSnake added in v0.7.5

func CamelToSnake(val, separator string) string

Convert a camel string to snake case. Already snake cased strings aren't modified.

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 SnakeToCamel added in v0.7.5

func SnakeToCamel(val, separator string) (res string)

Convert a snake cased string to camel case. Ignores strings that already have camel casing.

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