common

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WORDS = []string{
	"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten",
	"eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty",
}

Functions

func CamelLowerCase

func CamelLowerCase(s string) string

CamelCase returns a string representation of the value in CamelCase.

func CamelTitleCase

func CamelTitleCase(s string) string

CamelTitleCase returns a string representation of the value in CamelTitleCase.

func CamelUpperCase

func CamelUpperCase(s string) string

CamelUpperCase returns a string representation of the value in CamelCase.

func Contains added in v0.33.0

func Contains(a []any, s string) bool

func DotLowerCase

func DotLowerCase(s string) string

DotLowerCase returns a string representation of the value in dot.case

func DotTitleCase

func DotTitleCase(s string) string

DotTitleCase returns a string representation of the value in dot.case

func DotUpperCase

func DotUpperCase(s string) string

DotUpperCase returns a string representation of the value in DOT.CASE

func FirstChar

func FirstChar(s string) string

FirstChar returns the first character of the value.

func FirstCharLower

func FirstCharLower(s string) string

FirstCharLower returns the first character of the value in lowercase.

func FirstCharUpper

func FirstCharUpper(s string) string

FirstCharUpper returns the first character of the value in UPPER CASE.

func IndexOf added in v0.33.0

func IndexOf(a []any, s string) int

func IntToWord

func IntToWord(i int, prefix string, postfix string, wc strcase.WordCase) string

func IntToWordLower

func IntToWordLower(i int, prefix string, postfix string) string

func IntToWordTitle

func IntToWordTitle(i int, prefix string, postfix string) string

func IntToWordUpper

func IntToWordUpper(i int, prefix string, postfix string) string

func Join

func Join(sep string, a []string) string

func KebabLowerCase

func KebabLowerCase(s string) string

KebabLowerCase returns a string representation of the value in kebap-case.

func KebabTitleCase

func KebabTitleCase(s string) string

KebabTitleCase returns a string representation of the value in kebab-case.

func KebabUpperCase

func KebabUpperCase(s string) string

KebapCaseUpper returns a string representation of the value in KEBAP-CASE.

func LowerCase

func LowerCase(s string) string

LowerCase returns a string representation of the value in lowercase.

func LowerFirst

func LowerFirst(s string) string

LowerFirst returns a string representation of the value with the first character in lowercase.

func NewLine

func NewLine() string

func PathLowerCase

func PathLowerCase(s string) string

PathLowerCase returns a string representation of the value in path/case.

func PathTitleCase

func PathTitleCase(s string) string

PathTitleCase returns a string representation of the value in path/case.

func PathUpperCase

func PathUpperCase(s string) string

PathUpperCase returns a string representation of the value in PATH/CASE.

func Pluralize

func Pluralize(s string, i int) string

func Replace

func Replace(s, old, new string) string

func SnakeCaseLower

func SnakeCaseLower(s string) string

SnakeCaseLower returns a string representation of the value in snake_case.

func SnakeTitleCase

func SnakeTitleCase(s string) string

SnakeTitleCase returns a string representation of the value in snake_case.

func SnakeUpperCase

func SnakeUpperCase(s string) string

First returns the first character of the value.

func SpaceLowerCase added in v0.30.0

func SpaceLowerCase(s string) string

SpaceLowerCase returns a string representation of the value in space lower case.

func SpaceTitleCase added in v0.30.0

func SpaceTitleCase(s string) string

SpaceTitleCase returns a string representation of the value in Space Title Case.

func SpaceUpperCase added in v0.30.0

func SpaceUpperCase(s string) string

SpaceUpperCase returns a string representation of the value in SPACE UPPER CASE.

func Split added in v0.30.0

func Split(s, sep string) []string

func SplitFirst added in v0.30.0

func SplitFirst(s, sep string) string

func SplitLast added in v0.30.0

func SplitLast(s, sep string) string

SplitLast splits the string s at the last occurrence of sep and returns the result.

func ToJson added in v0.30.0

func ToJson(v any) (string, error)

func Trim added in v0.30.0

func Trim(s string) string

func TrimPrefix

func TrimPrefix(s, prefix string) string

func TrimSuffix

func TrimSuffix(s, postfix string) string

func UpperCase

func UpperCase(s string) string

UpperCase returns a string representation of the value in UPPER CASE.

func UpperFirst

func UpperFirst(s string) string

UpperFirst returns a string representation of the value with the first character in UPPER CASE.

Types

This section is empty.

Jump to

Keyboard shortcuts

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