stringutils

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 9

Documentation

Index

Constants

View Source
const GB = 1 << 30
View Source
const KB = 1 << 10
View Source
const MB = 1 << 20

Variables

This section is empty.

Functions

func ContainsString added in v0.0.6

func ContainsString(stringList []string, s string) bool

func FormatLen added in v0.0.7

func FormatLen(s string) int

func HumanBytes added in v0.0.6

func HumanBytes(size int) string

func IsUUID added in v0.0.6

func IsUUID(s string) bool

func JsonDumpsIndent added in v0.0.6

func JsonDumpsIndent(v interface{}) (string, error)

func MustGreaterThan

func MustGreaterThan(arg string, min int) (int, error)

func MustInIntChoises

func MustInIntChoises(arg string, choises []int) (int, error)

func MustInRange

func MustInRange(arg string, min int, max int) (int, error)

func MustInStringChoises

func MustInStringChoises(arg string, choises []string) error

func MustLessThen

func MustLessThen(arg string, min int) (int, error)

func MustMatch

func MustMatch(arg string, pattern string) error

func PathJoin added in v0.0.6

func PathJoin(path ...string) string

func ScanfComfirm added in v0.0.6

func ScanfComfirm(message string, yes, no []string) bool

func SubStrings added in v0.0.7

func SubStrings(s string, width int) []string

Parse a string to substrings

e.g. if width is 2:

"a"    -> ["a"]
"abc"  -> ["ab", "c"]
"abcd" -> ["ab", "cd"]

func TextWidth added in v0.0.7

func TextWidth(s string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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