package
0.0.0-20250225133122-0516d5b855ff
Repository: https://github.com/domonda/go-types.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

CompareStringsShorterFirst compares two strings by length first and then by lexicographical order.
ConvertSlice converts a slice of one string type type to another string type.
CutTrimSpace slices s around the first instance of sep, returning the text before and after sep with all leading and trailing white space removed, as defined by Unicode.
DerefPtr returns the string ptr points to or an empty string if ptr is nil.
EmptyStringToNil returns str or nil if it is empty.
EqualJSON returns true a and b are equal on a value basis, or if their marshalled JSON representation is equal.
EqualPtrOrString returns if a and b are equal pointers or if the pointed to strings are equal.
No description provided by the author
IndexInStrings returns the index of where str can be found in slice, or -1 if it was not found.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IsSpace reports whether r is a space character as defined by Unicode or zero width space '\u200b'.
No description provided by the author
Join concatenates the elements of its first argument to create a single string.
KeepRunes returns a copy of str where with all runes kept in it where any call to a keepRunes function reeturns true.
KeepRunesString returns a copy of str where with all runes kept in it where any call to a keepRunes function reeturns true.
MakeValidFileName replaces invalid filename characters with '_'.
No description provided by the author
No description provided by the author
No description provided by the author
NewStrMutex returns a new StrMutex.
No description provided by the author
No description provided by the author
No description provided by the author
Ptr returns the passed string as pointer value.
RandomString returns an URL compatible random string with the requested length.
RandomStringBytes returns an URL compatible random string with the requested length as []byte slice, saving a string copy compared to RandomString.
RemoveRunes returns a copy of str with all runes removed where any call to a removeRunes function reeturns true.
RemoveRunesString returns a copy of str with all runes removed where any call to a removeRunes function reeturns true.
SanitizeFileName creates a nice sane filename.
SanitizeLineEndings converts all line endings to just '\n'.
SanitizeLineEndingsBytes converts all line endings to just '\n'.
SplitAndTrimIndex first splits str into words not containing isSplitRune, then trims the words with isTrimRune.
StringContainsAny returns if str is a sub string in any of subStrings.
StringToPtrEmptyToNil returns the address of a string or nil if the string is empty.
SubStringIn returns if subString is equal or a substring of any of strs.
ToSnakeCase converts s to snake case by lower casing everything and inserting '_' before every new upper case character in s.
TransliterateSpecialCharacters returns the string sanitized as valid UTF-8 with common European special characters transliterated to single or multiple ANSI characters.
TransliterateSpecialCharactersMaxLen returns the string sanitized as valid UTF-8 with common European special characters transliterated to single or multiple ANSI characters.
TrimSpace returns a slice of the string s, with all leading and trailing white space removed including zero width space '\u200b'.
TrimSpaceBytes returns a slice of the bytes string s, with all leading and trailing white space removed including zero width space '\u200b'.
No description provided by the author
No description provided by the author

# Structs

StrMutex manages a unique mutex for every locked string key.

# Type aliases

IsRuneFunc is function pionter for specifying if a rune matches a criteria.
No description provided by the author