strings

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool added in v0.4.0

func Bool(val bool) string

func Complex128 added in v0.4.0

func Complex128(val complex128) string

func Complex64 added in v0.4.0

func Complex64(val complex64) string

func DollarsAndCents added in v0.13.0

func DollarsAndCents(val float64) string

func DollarsAndTenthsOfCents added in v0.13.0

func DollarsAndTenthsOfCents(val float64) string

func DollarsMaxPrecision added in v0.13.0

func DollarsMaxPrecision(val float64) string

func EnsureBlankLineIfNotEmpty added in v0.17.0

func EnsureBlankLineIfNotEmpty(str string) string

func EnsurePrefix added in v0.4.0

func EnsurePrefix(str string, prefix string) string

func EnsureSingleOccurrenceCharPrefix added in v0.22.0

func EnsureSingleOccurrenceCharPrefix(str string, character string) string

func EnsureSingleOccurrenceCharSuffix added in v0.22.0

func EnsureSingleOccurrenceCharSuffix(str string, character string) string

func EnsureSingleTrailingNewLine added in v0.13.0

func EnsureSingleTrailingNewLine(str string) string

func EnsureSuffix added in v0.4.0

func EnsureSuffix(str string, suffix string) string

func EsIfPlural added in v0.20.0

func EsIfPlural(count interface{}) string

func Float32 added in v0.4.0

func Float32(val float32) string

func Float64 added in v0.4.0

func Float64(val float64) string

func HasPrefixAndSuffix added in v0.4.0

func HasPrefixAndSuffix(str string, substr string) bool

func Indent added in v0.5.0

func Indent(str string, indent string) string

func Index added in v0.4.0

func Index(index int) string

func Int added in v0.4.0

func Int(val int) string

func Int16 added in v0.4.0

func Int16(val int16) string

func Int32 added in v0.4.0

func Int32(val int32) string

func Int64 added in v0.4.0

func Int64(val int64) string

func Int64ToBase2Byte added in v0.19.0

func Int64ToBase2Byte(size int64) string

func Int8 added in v0.4.0

func Int8(val int8) string

func LastNChars added in v0.20.0

func LastNChars(str string, n int) string

Returns the last n chars, or the entire string if the requested length is greater than the length of the string

func LastSplit added in v0.20.0

func LastSplit(str string, chars string) string

Returns the portion str after the last occurrance of chars, or the entire str if chars are not found

func LongestCommonPrefix added in v0.4.0

func LongestCommonPrefix(strs ...string) string

func MaskString added in v0.4.0

func MaskString(str string, numPlain int) string

MaskString omits no more than half of the string

func MaxLen added in v0.5.0

func MaxLen(strs ...string) int

func Obj added in v0.4.0

func Obj(val interface{}) string

func ObjFlat added in v0.4.0

func ObjFlat(val interface{}) string

func ObjFlatNoQuotes added in v0.6.0

func ObjFlatNoQuotes(val interface{}) string

func ObjStripped added in v0.20.0

func ObjStripped(val interface{}) string

Same as Obj(), but trim leading and trailing quotes if it's just a string

func ParseBool added in v0.4.0

func ParseBool(valStr string) (bool, bool)

func ParseFloat32 added in v0.4.0

func ParseFloat32(valStr string) (float32, bool)

func ParseFloat64 added in v0.4.0

func ParseFloat64(valStr string) (float64, bool)

func ParseInt added in v0.4.0

func ParseInt(valStr string) (int, bool)

func ParseInt16 added in v0.4.0

func ParseInt16(valStr string) (int16, bool)

func ParseInt32 added in v0.4.0

func ParseInt32(valStr string) (int32, bool)

func ParseInt64 added in v0.4.0

func ParseInt64(valStr string) (int64, bool)

func ParseInt8 added in v0.4.0

func ParseInt8(valStr string) (int8, bool)

func PluralCustom added in v0.17.0

func PluralCustom(singular string, plural string, count interface{}) string

func PluralEs added in v0.17.0

func PluralEs(str string, count interface{}) string

func PluralS added in v0.17.0

func PluralS(str string, count interface{}) string

func Round

func Round(val float64, decimalPlaces int, padToDecimalPlaces int) string

func SIfPlural added in v0.20.0

func SIfPlural(count interface{}) string

func StrIfPlural added in v0.20.0

func StrIfPlural(str string, count interface{}) string

func StrsAnd added in v0.4.0

func StrsAnd(strs []string) string

func StrsOr added in v0.4.0

func StrsOr(strs []string) string

func StrsSentence added in v0.4.0

func StrsSentence(strs []string, lastJoinWord string) string

func ToTitle added in v0.4.0

func ToTitle(str string) string

func TrimPrefixAndSuffix added in v0.4.0

func TrimPrefixAndSuffix(str string, substr string) string

func TrimPrefixIfPresentInAll added in v0.4.0

func TrimPrefixIfPresentInAll(strs []string, prefix string) ([]string, bool)

func TrimTrailingNewLines added in v0.18.0

func TrimTrailingNewLines(str string) string

func TrimTrailingWhitespace added in v0.18.0

func TrimTrailingWhitespace(str string) string

func TruncateEllipses added in v0.8.0

func TruncateEllipses(str string, maxLength int) string

func Uint added in v0.4.0

func Uint(val uint) string

func Uint16 added in v0.4.0

func Uint16(val uint16) string

func Uint32 added in v0.4.0

func Uint32(val uint32) string

func Uint64 added in v0.4.0

func Uint64(val uint64) string

func Uint8 added in v0.4.0

func Uint8(val uint8) string

func Uintptr added in v0.4.0

func Uintptr(val uintptr) string

func UserStr added in v0.4.0

func UserStr(val interface{}) string

func UserStrStripped added in v0.4.0

func UserStrStripped(val interface{}) string

func UserStrValue added in v0.4.0

func UserStrValue(val reflect.Value) string

func UserStrs added in v0.4.0

func UserStrs(val interface{}) []string

func UserStrsAnd added in v0.4.0

func UserStrsAnd(vals interface{}) string

func UserStrsOr added in v0.4.0

func UserStrsOr(vals interface{}) string

func YesNo added in v0.11.0

func YesNo(val bool) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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