package
0.0.0-20240106075236-2e001e6401ef
Repository: https://github.com/agrison/go-commons-lang.git
Documentation: pkg.go.dev

# Functions

Abbreviate abbreviates a string using ellipses.
AbbreviateWithOffset abbreviates a string using ellipses at a specific offset.
AppendIfMissing appends a suffix to a string if missing.
AppendIfMissingIgnoreCase appends a suffix to a string if missing (ignoring case).
Capitalize capitalizes a string changing the first letter to title case.
Chomp removes one newline from end of a string if it's there, otherwise leave it alone.
Chop removes the last character from a string.
Contains checks if string contains a search string.
ContainsAny checks if the string contains any of the string in the given array.
ContainsAnyCharacter checks if the string contains any of the character in the given string.
ContainsIgnoreCase checks if the string contains the searched string ignoring case.
ContainsNone checks if the string contains no occurrence of searched string.
ContainsNoneCharacter checks if the string contains no occurrence of searched string.
ContainsOnly checks if a string contains only some strings.
Returns either the passed in String, or if the String is Empty, the value of defaultStr.
EndsWith check if a string ends with a specified suffix.
EndsWithAny check if a string ends with any of an array of specified strings.
EndsWithAnyIgnoreCase check if a string ends with any of an array of specified strings (ignoring case).
EndsWithIgnoreCase case insensitive check if a string ends with a specified suffix.
IsAllLowerCase checks if the string contains only lowercase characters.
IsAllUpperCase checks if the string contains only uppercase characters.
IsAlpha checks if the string contains only Unicode letters.
IsAlphanumeric checks if the string contains only Unicode letters and digits.
IsAlphanumericSpace checks if the string contains only Unicode letters, digits and spaces.
IsAlphaSpace checks if the string contains only Unicode letters and spaces.
IsAnyBlank checks if any one of the strings are empty or containing only whitespaces.
IsAnyEmpty checks if any one of the given strings are empty.
IsBlank checks if a string is whitespace or empty.
IsEmpty checks if a string is empty.
IsNoneBlank checks if none of the strings are empty or containing only whitespaces.
IsNoneEmpty checks if none of the strings are empty.
IsNotBlank checks if a string is not empty or containing only whitespaces.
IsNotEmpty checks if a string is not empty.
IsNumeric checks if the string contains only digits.
IsNumericSpace checks if the string contains only digits and whitespace.
IsWhitespace checks if the string contains only whitespace.
Join joins an array of strings into a string where each item of the array is separated with a separator.
JoinBool is the same as Join but joining boolean.
JoinFloat64 is the same as Join but joining float64.
JoinFloat64WithFormatAndPrecision is the same as Join but joining float64 with a custom precision (bitSize) and format.
JoinInt is the same as Join but joining integers.
JoinInt64 is the same as Join but joining int64.
JoinUint64 is the same as Join but joining uint64.
Left gets the leftmost len characters of a string.
LowerCase converts a string to lower case.
Mid gets size characters from the middle of a string.
Overlay overlays part of a string with another string.
PrependIfMissing prepends the prefix to the start of the string if the string does not already start with any of the prefixes.
PrependIfMissing prepends the prefix to the start of the string if the string does not already start, case-insensitive, with any of the prefixes.
Remove removes all occurrences of a substring from within the source string.
RemoveEnd removes a substring only if it is at the end of a source string, otherwise returns the source string.
RemoveEndIgnoreCase is the case insensitive removal of a substring if it is at the end of a source string, otherwise returns the source string.
RemovePattern removes each substring of the source string that matches the given regular expression.
RemoveStart removes a substring only if it is at the beginning of a source string, otherwise returns the source string.
RemoveStartIgnoreCase is the case insensitive removal of a substring if it is at the beginning of a source string, otherwise returns the source string.
Repeat repeats a string `repeat` times to form a new string.
RepeatWithSeparator repeats a string `repeat` times to form a new String, with a string separator injected each time.
Reverse reverses a string.
ReverseDelimited reverses a string separated by a delimiter.
Right gets the rightmost len characters of a string.
StartsWith check if a string starts with a specified prefix.
StartsWithAny check if a string starts with any of an array of specified strings.
StartsWithAnyIgnoreCase check if a string starts with any of an array of specified strings (ignoring case).
StartsWithIgnoreCase case insensitive check if a string starts with a specified prefix.
Strip strips whitespace from the start and end of a String.
StripEnd strips whitespace from the end of a String.
StripStart strips whitespace from the start of a String.
SubstringAfter gets the substring after the first occurrence of a separator.
SubstringAfterLast gets the substring after the last occurrence of a separator.
SubstringBefore gets the substring before the first occurrence of a separator.
SubstringBeforeLast gets the substring before the last occurrence of a separator.
SwapCase swaps the case of a String changing upper and title case to lower case, and lower case to upper case.
Trim removes control characters from both ends of this string.
Uncapitalize uncapitalizes a String, changing the first letter to lower case.
UpperCase converts a string to upper case.
Wrap wraps a string with another string.