zstring

package
v0.10.12 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 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, minWordSize int) 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 CutAt added in v0.9.1

func CutAt(val string, index int) (left, right string)

Cut the string at the specified index

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 IsLowercase added in v0.8.9

func IsLowercase(val string) bool

Determines if all characters in a string are lowercase

func IsUppercase added in v0.8.9

func IsUppercase(val string) bool

Determines if all characters in a string are uppercase

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, minWordSize int) (res string)

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

func SplitSpace added in v0.9.21

func SplitSpace(val string) (parts []string)

Split a string on space characters and trim leading/trailing space from each part

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