strs

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camel

func Camel[I BS](s I) (out I)

func Clean

func Clean[T comparable](c []T, fix ...func(item T) T) []T

func From

func From(v any) string

From casts any value to a string type.

func FromE

func FromE(v any) (string, error)

From casts any value to a string type.

func HumanBytes

func HumanBytes[T Num](i T) string

func PadLeft

func PadLeft[I, P BS](s I, n int, pad P) I

func PadRight

func PadRight[I, P BS](s I, n int, pad P) I

func Snake

func Snake[I BS](s I, upper ...bool) (out I)

func Title

func Title[I BS](s I) (out I)

func ToInt

func ToInt[o Int](s any) o

func ToIntOr

func ToIntOr[o Int](s any, def o) o

Types

type BS

type BS interface {
	~string | []byte
}

type Float

type Float interface {
	~float32 | ~float64
}

type Int

type Int interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
}

type Num

type Num interface {
	Int | Float
}

Jump to

Keyboard shortcuts

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