utility

package
v0.9.0-alpha-1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByLenDesc

type ByLenDesc []string

func (ByLenDesc) Len

func (arr ByLenDesc) Len() int

func (ByLenDesc) Less

func (arr ByLenDesc) Less(i, j int) bool

func (ByLenDesc) Swap

func (arr ByLenDesc) Swap(i, j int)

type StrUtil

type StrUtil struct {
	Util *Util
}

func NewStrUtil

func NewStrUtil(utl *Util) *StrUtil

func (*StrUtil) AddPrefix

func (struUtil *StrUtil) AddPrefix(s, prefix string) (prefixedStr string)

func (*StrUtil) CompleteLines

func (strUtil *StrUtil) CompleteLines(lines, patterns, suplements []string) (newLines []string, err error)

func (*StrUtil) DoubleQuote

func (strUtil *StrUtil) DoubleQuote(s string) (result string)

func (*StrUtil) EscapeShellArg

func (strUtil *StrUtil) EscapeShellArg(s string) (result string)

func (*StrUtil) FullIndent

func (strUtil *StrUtil) FullIndent(multiLineStr string, indentation string) (indentedStr string)

func (*StrUtil) GetIndentation

func (strUtil *StrUtil) GetIndentation(s string, level int) (result string, err error)

func (*StrUtil) GetLineSubmatch

func (strUtil *StrUtil) GetLineSubmatch(lines, patterns []string) (matchIndex int, submatch []string, err error)

func (*StrUtil) GetSubKeys

func (strUtil *StrUtil) GetSubKeys(keys []string, parentKeys []string) (subKeys []string)

GetSubKeys get sub keys from dictionary

func (*StrUtil) GetUniqueElements

func (strUtil *StrUtil) GetUniqueElements(arr []string) (result []string)

func (*StrUtil) Indent

func (strUtil *StrUtil) Indent(multiLineStr string, indentation string) (indentedStr string)

indent second-last lines

func (*StrUtil) IsLower

func (strUtil *StrUtil) IsLower(s string) (result bool)

func (*StrUtil) IsUpper

func (strUtil *StrUtil) IsUpper(s string) (result bool)

func (*StrUtil) NewUUID

func (struUtil *StrUtil) NewUUID() (uuidStr string)

func (*StrUtil) PadLeft

func (strUtil *StrUtil) PadLeft(s string, length int, pad string) (result string)

func (*StrUtil) PadRight

func (strUtil *StrUtil) PadRight(s string, length int, pad string) (result string)

func (*StrUtil) Quote

func (strUtil *StrUtil) Quote(s string, quote byte) (result string)

func (*StrUtil) Repeat

func (strUtil *StrUtil) Repeat(s string, repetition int) (result string)

func (*StrUtil) Replace

func (strUtil *StrUtil) Replace(s string, replacementMap map[string]string) (result string)

func (*StrUtil) ReplaceLineAtIndex

func (strUtil *StrUtil) ReplaceLineAtIndex(lines []string, index int, replacements []string) (result []string, err error)

func (*StrUtil) SingleQuote

func (strUtil *StrUtil) SingleQuote(s string) (result string)

func (*StrUtil) Split

func (strUtil *StrUtil) Split(s string, separator string) (result []string)

func (*StrUtil) Submatch

func (strUtil *StrUtil) Submatch(s string, pattern string) (result []string, err error)

func (*StrUtil) ToCamel

func (strUtil *StrUtil) ToCamel(s string) (result string)

func (*StrUtil) ToKebab

func (strUtil *StrUtil) ToKebab(s string) (result string)

func (*StrUtil) ToLower

func (strUtil *StrUtil) ToLower(s string) (result string)

func (*StrUtil) ToPascal

func (strUtil *StrUtil) ToPascal(s string) (result string)

func (*StrUtil) ToSnake

func (strUtil *StrUtil) ToSnake(s string) (result string)

func (*StrUtil) Trim

func (strUtil *StrUtil) Trim(str, cutset string) (trimmedStr string)

type Util

type Util struct {
	Str *StrUtil
}

func NewUtil

func NewUtil() *Util

Jump to

Keyboard shortcuts

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