strings

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RxBasicMimeType = regexp.MustCompile(`^\s*([^\s;]*)\s*.+?\s*$`)
View Source
var (
	RxNameSuffix = regexp.MustCompile(`\((\d+)\)\s*$`)
)

Functions

func AddClassNamesToNjnBlock

func AddClassNamesToNjnBlock(data map[string]interface{}, classes ...string) map[string]interface{}

func AnyStringsInStrings added in v0.2.11

func AnyStringsInStrings(src, tgt []string) (found bool)

func AppendWithSpace

func AppendWithSpace(src, add string) (combined string)

func Diff added in v0.5.0

func Diff(filename, a, b string) (patch string)

func Empty

func Empty(value string) (empty bool)

func EscapeHtmlAttribute

func EscapeHtmlAttribute(unescaped string) (escaped string)

func FirstName

func FirstName(fullName string) (firstName string)

func GetBasicMime

func GetBasicMime(mime string) (basic string)

func IncrementFileName added in v0.5.0

func IncrementFileName(name string) (modified string)

IncrementFileName will return the given label with a specific number suffix incremented. If the label does not end with the pattern `\(\d+\)\s*$`, one is appended with a space, if the pattern matches no spaces are added and the digit is modified and any trailing space removed

func IsFalse

func IsFalse(text string) bool

func IsTrue

func IsTrue(text string) bool

func LastName

func LastName(fullName string) (lastName string)

func LowerStrings

func LowerStrings(in ...string) (out []string)

func NameFromEmail added in v0.5.0

func NameFromEmail(email string) (name string)

func ParseHtmlTagAttributes

func ParseHtmlTagAttributes(input interface{}) (attributes map[string]interface{}, err error)

func PathToSnake added in v0.2.0

func PathToSnake(path string) (snake string)

func QuoteJsonValue

func QuoteJsonValue(in string) (out string)

QuoteJsonValue will quote everything other than numbers or boolean text

func SortedByLastName added in v0.2.11

func SortedByLastName(data []string) (keys []string)

func StringIndexInSlice

func StringIndexInSlice(src string, dst []string) int

func StringIndexInStrings

func StringIndexInStrings(src string, dst ...string) int

func StringsToKebabs

func StringsToKebabs(in ...string) (out []string)

func StripTmplTags

func StripTmplTags(value string) (clean string)

func TitleCase

func TitleCase(input string) (output string)

func ToCamelWords added in v0.5.0

func ToCamelWords(text string) (capitalized string)

func ToDeepKey added in v0.5.0

func ToDeepKey(s string) (deepKey string)

func ToDeepVar added in v0.5.0

func ToDeepVar(s string) (deepKey string)

func ToSpaced added in v0.5.0

func ToSpaced(s string) (spaced string)

func ToSpacedCamel added in v0.5.0

func ToSpacedCamel(s string) (spacedCamel string)

func TrimPrefixes

func TrimPrefixes(value string, prefixes ...string) (trimmed string)

func TrimQuotes

func TrimQuotes(maybeQuoted string) (unquoted string)

func UniqueFromSpaceSep

func UniqueFromSpaceSep(value string, original []string) (updated []string)

Types

type CByteBuffer added in v0.5.0

type CByteBuffer struct {
	bytes.Buffer
}

func NewByteBuffer added in v0.5.0

func NewByteBuffer() (c *CByteBuffer)

func (*CByteBuffer) Close added in v0.5.0

func (c *CByteBuffer) Close() error

type SortByLengthAsc

type SortByLengthAsc []string

func (SortByLengthAsc) Len

func (a SortByLengthAsc) Len() int

func (SortByLengthAsc) Less

func (a SortByLengthAsc) Less(i, j int) bool

func (SortByLengthAsc) Swap

func (a SortByLengthAsc) Swap(i, j int)

type SortByLengthDesc

type SortByLengthDesc []string

func (SortByLengthDesc) Len

func (a SortByLengthDesc) Len() int

func (SortByLengthDesc) Less

func (a SortByLengthDesc) Less(i, j int) bool

func (SortByLengthDesc) Swap

func (a SortByLengthDesc) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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