Documentation
¶
Index ¶
- func Abbreviate(s, abbreviateMarker string, offset, maxWidth int) string
- func AbbreviateMiddle(s, middle string, length int) string
- func AppendIfMissing(s, suffix string, suffixes ...string) string
- func AppendIfMissingIgnoreCase(s, suffix string, suffixes ...string) string
- func Capitalize(s string) string
- func Center(s string, size int, padCharacter uint8) string
- func CenterString(s string, size int, padString string) string
- func Chomp(s string) string
- func Chop(s string) string
- func Compare(a, b string) int
- func CompareIgnoreCase(a, b string) int
- func Contains(s string, searchChar uint8) bool
- func ContainsAny(s string, searchChars ...uint8) bool
- func ContainsAnyIgnoreCase(s string, searchChars ...uint8) bool
- func ContainsIgnoreCase(s string, searchChar uint8) bool
- func ContainsNone(s string, searchChars ...uint8) bool
- func ContainsNoneIgnoreCase(s string, searchChars ...uint8) bool
- func ContainsOnly(s string, validChars ...uint8) bool
- func ContainsOnlyIgnoreCase(s string, validChars ...uint8) bool
- func ContainsString(s, search string) bool
- func ContainsStringIgnoreCase(s, search string) bool
- func ContainsWhitespace(s string) bool
- func Count(s string, ch uint8) int
- func CountIgnoreCase(s string, ch uint8) int
- func DefaultIfBlank(s, df string) string
- func DefaultIfEmpty(s, df string) string
- func DeleteWhitespaces(s string) string
- func Difference(a, b string) string
- func EndsWith(s, suffix string) bool
- func EndsWithAny(s string, suffixes ...string) bool
- func EndsWithAnyIgnoreCase(s string, suffixes ...string) bool
- func EndsWithIgnoreCase(s, suffix string) bool
- func Equals(a, b string) bool
- func EqualsAny(a string, bb ...string) bool
- func EqualsAnyIgnoreCase(a string, bb ...string) bool
- func EqualsIgnoreCase(a, b string) bool
- func FirstNonBlank(ss ...string) string
- func FirstNonEmpty(ss ...string) string
- func GetCommonPrefix(ss ...string) string
- func GetDigits(s string) string
- func GetIfBlank(ctx context.Context, s string, supplier func(ctx context.Context) string) string
- func GetIfEmpty(ctx context.Context, s string, supplier func(ctx context.Context) string) string
- func HashCode(s string) int32
- func IndexOf(s string, search uint8) int
- func IndexOfAny(s string, searchChars ...uint8) int
- func IndexOfAnyBut(s string, searchChars ...uint8) int
- func IndexOfAnyButIgnoreCase(s string, searchChars ...uint8) int
- func IndexOfAnyIgnoreCase(s string, searchChars ...uint8) int
- func IndexOfDifference(ss ...string) int
- func IndexOfIgnoreCase(s string, search uint8) int
- func IndexOfString(s, search string) int
- func IndexOfStringIgnoreCase(s, search string) int
- func IndexOfStringStartingAt(s, search string, start int) int
- func IsAllBlank(ss ...string) bool
- func IsAllEmpty(ss ...string) bool
- func IsAllLowerCase(ss ...string) bool
- func IsAllMixedCase(ss ...string) bool
- func IsAllUpperCase(ss ...string) bool
- func IsAlpha(s string) bool
- func IsAlphaNumeric(s string) bool
- func IsAlphaNumericSpace(s string) bool
- func IsAlphaSpace(s string) bool
- func IsAnyBlank(ss ...string) bool
- func IsAnyEmpty(ss ...string) bool
- func IsAnyLowerCase(ss ...string) bool
- func IsAnyMixedCase(ss ...string) bool
- func IsAnyUpperCase(ss ...string) bool
- func IsAsciiPrintable(s string) bool
- func IsBlank(s string) bool
- func IsEmpty(s string) bool
- func IsLowerCase(s string) bool
- func IsMixedCase(s string) bool
- func IsNoneBlank(ss ...string) bool
- func IsNoneEmpty(ss ...string) bool
- func IsNumeric(s string) bool
- func IsNumericSpace(s string) bool
- func IsUpperCase(s string) bool
- func JoinByChar(cc []uint8, d uint8) string
- func JoinStringersByChar[K any](ss []K, d uint8, stringer func(a K) string) string
- func JoinStringersByString[K any](ss []K, ds string, stringer func(a K) string) string
- func JoinStringsByChar(ss []string, d uint8) string
- func JoinStringsByString(ss []string, ds string) string
- func LastIndexOf(s string, search uint8) int
- func LastIndexOfAny(s string, searchChars ...uint8) int
- func LastIndexOfAnyBut(s string, searchChars ...uint8) int
- func LastIndexOfAnyButIgnoreCase(s string, searchChars ...uint8) int
- func LastIndexOfAnyIgnoreCase(s string, searchChars ...uint8) int
- func LastIndexOfIgnoreCase(s string, search uint8) int
- func LastIndexOfString(s, search string) int
- func LastIndexOfStringIgnoreCase(s, search string) int
- func Left(s string, l int) string
- func LeftPad(s string, size int, padCharacter uint8) string
- func LeftPadString(s string, size int, padString string) string
- func LowerCase(s string) string
- func Mid(s string, pos, length int) string
- func NormalizeSpace(s string) string
- func OrdinalIndexOf(s, search string, ordinal int) int
- func Overlay(s, overlay string, start, end int) string
- func PrependIfMissing(s, prefix string, prefixes ...string) string
- func PrependIfMissingIgnoreCase(s, prefix string, prefixes ...string) string
- func Remove(s string, remove uint8) string
- func RemoveEnd(s, remove string) string
- func RemoveEndIgnoreCase(s, remove string) string
- func RemoveIgnoreCase(s string, remove uint8) string
- func RemoveStart(s, remove string) string
- func RemoveStartIgnoreCase(s, remove string) string
- func RemoveString(s, remove string) string
- func RemoveStringIgnoreCase(s, remove string) string
- func Repeat(c uint8, repeat int) string
- func RepeatString(s string, repeat int) string
- func RepeatStringWithSeparator(s, separator string, repeat int) string
- func Replace(s, search, replacement string, max int) string
- func ReplaceAll(s, search, replacement string) string
- func ReplaceEach(s string, searchList, replacementList []string) string
- func ReplaceIgnoreCase(s, search, replacement string, max int) string
- func Reverse(s string) string
- func ReverseDelimited(s string, d uint8) string
- func Right(s string, l int) string
- func RightPad(s string, size int, padCharacter uint8) string
- func RightPadString(s string, size int, padString string) string
- func Rotate(s string, shift int) string
- func Split(s string, separator uint8) []string
- func SplitByString(s, separator string) []string
- func SplitByStringWithTrim(s, separator string) []string
- func SplitByStringWithTrimCutSet(s, separator string, set string) []string
- func SplitN(s string, separator uint8, n int) []string
- func SplitNByString(s, separator string, n int) []string
- func SplitNByStringWithTrim(s, separator string, n int) []string
- func SplitNByStringWithTrimCutSet(s, separator string, n int, set string) []string
- func SplitNWithTrim(s string, separator uint8, n int) []string
- func SplitNWithTrimCutSet(s string, separator uint8, n int, set string) []string
- func SplitWithTrim(s string, separator uint8) []string
- func SplitWithTrimCutSet(s string, separator uint8, set string) []string
- func StartsWith(s, prefix string) bool
- func StartsWithAny(s string, prefixes ...string) bool
- func StartsWithAnyIgnoreCase(s string, prefixes ...string) bool
- func StartsWithIgnoreCase(s, prefix string) bool
- func Strip(s, cc string) string
- func StripAll(ss []string, cc string) []string
- func StripAllEnd(ss []string, cc string) []string
- func StripAllStart(ss []string, cc string) []string
- func StripEnd(s, cc string) string
- func StripStart(s, cc string) string
- func Substring(s string, start, end int) string
- func SubstringAfter(s string, separator uint8) string
- func SubstringAfterLast(s string, separator uint8) string
- func SubstringAfterLastString(s, separator string) string
- func SubstringAfterString(s, separator string) string
- func SubstringBefore(s string, separator uint8) string
- func SubstringBeforeLast(s string, separator uint8) string
- func SubstringBeforeLastString(s, separator string) string
- func SubstringBeforeString(s, separator string) string
- func SubstringTillEnd(s string, start int) string
- func SwapCase(s string) string
- func ToCodePoints(s string) []int32
- func Trim(s, cc string) string
- func TrimLeft(s, cc string) string
- func TrimPrefix(s, prefix string) string
- func TrimRight(s, cc string) string
- func TrimSpace(s string) string
- func TrimSuffix(s, suffix string) string
- func Truncate(s string, offset, maxWidth int) string
- func TruncateFromStart(s string, maxWidth int) string
- func Uncapitalize(s string) string
- func UpperCase(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abbreviate ¶
Abbreviate is used to abbreviate the given string with the given replacement character. An abbreviation is a shortened form of a word or phrase.
func AbbreviateMiddle ¶
AbbreviateMiddle is used to abbreviate a string to the passed length by replacing the middle characters with the supplied replacement string.
The method works only if the following conditions are met. The length of the supplied string should be greater than the length of the abbreviated string. The length of the abbreviated string should be greater than zero.
func AppendIfMissing ¶
AppendIfMissing is used to append a given suffix at the end of a string if it does not already end with one on the given list.
func AppendIfMissingIgnoreCase ¶
AppendIfMissingIgnoreCase is used to append a given suffix at the end of a string if it does not already end with one on the given list ignoring case.
func Capitalize ¶
Capitalize used to convert the first character of the given string to upper case. The remaining characters of the string are not changed.
func Center ¶
Center centers a string in a larger string of given size padding around the given string the given pad character.
func CenterString ¶
CenterString centers a string in a larger string of given size padding around the given string the given pad string.
func Chomp ¶
Chomp is used to remove the last occurring newline character in a given string. If the string ends with multiple newline characters, then only the last occurring newline character is removed. The newline characters are \r, \n or \r\n.
func Chop ¶
Chop is used to remove the last character and the second last character if it's newline.
func Compare ¶
Compare returns an integer comparing two strings lexicographically. The result will be 0 if a==b, -1 if a < b, and +1 if a > b.h
func CompareIgnoreCase ¶
CompareIgnoreCase returns an integer comparing two strings ignoring case lexicographically. The result will be 0 if a==b, -1 if a < b, and +1 if a > b.
func ContainsAny ¶
ContainsAny is used to check if any of the characters is present in the string or not
func ContainsAnyIgnoreCase ¶
ContainsAnyIgnoreCase is used to check if any of the characters is present in the string or not ignoring case
func ContainsIgnoreCase ¶
ContainsIgnoreCase is used to check if the character is present in the string or not ignoring case
func ContainsNone ¶
ContainsNone is used to check if none of the characters is present in the string or not
func ContainsNoneIgnoreCase ¶
ContainsNoneIgnoreCase is used to check if none of the characters is present in the string or not ignoring case
func ContainsOnly ¶
ContainsOnly is used to check if the strings contains only the given valid characters
func ContainsOnlyIgnoreCase ¶
ContainsOnlyIgnoreCase is used to check if the strings contains only the given valid characters ignoring case
func ContainsString ¶
ContainsString is used to check if the string is present in the given string or not
func ContainsStringIgnoreCase ¶
ContainsStringIgnoreCase is used to check if the string is present in the string or not ignoring case
func ContainsWhitespace ¶
ContainsWhitespace is used to check if the string contains whitespace
func Count ¶
Count is used to count the number of occurrences of a character or a substring in a larger string/text. Here, character or substring matching is case-sensitive in nature.
func CountIgnoreCase ¶
CountIgnoreCase is used to count the number of occurrences of a character or a substring in a larger string/text. Here, character or substring matching is not case-sensitive in nature.
func DefaultIfBlank ¶
DefaultIfBlank takes 2 parameters a string and a default string. If the passed string is blank, then it returns the default string otherwise it returns the passed string.
A string is considered to be blank if it satisfied one of the criteria below. Length of string is 0. String contains only whitespace characters.
func DefaultIfEmpty ¶
DefaultIfEmpty takes 2 parameters a string and a default string. If the passed string is empty, then it returns the default string otherwise it returns the passed string.
func DeleteWhitespaces ¶
DeleteWhitespaces removes all the whitespace characters in a given string.
func Difference ¶
Difference is used to compare two strings and return the remaining characters of the second string that differ from the first string.
func EndsWith ¶
EndsWith checks whether the given string ends with the given string/suffix. This method is case-sensitive when comparing the suffix with the end of the string.
func EndsWithAny ¶
EndsWithAny checks whether the given string ends with the given any of the given strings/suffixes. This method is case-sensitive when comparing the suffix with the end of the string.
func EndsWithAnyIgnoreCase ¶
EndsWithAnyIgnoreCase checks whether the given string ends with the given any of the given strings/suffixes. This method is case-insensitive when comparing the suffix with the end of the string.
func EndsWithIgnoreCase ¶
EndsWithIgnoreCase checks if the given string ends with the given string/suffix. This method is case-insensitive when comparing the suffix with the end of the string.
func EqualsAnyIgnoreCase ¶
EqualsAnyIgnoreCase is used to check if a string is equal to any of the given strings or not ignoring case.
func EqualsIgnoreCase ¶
EqualsIgnoreCase is used to check if the 2 strings are equal or not ignoring case.
func FirstNonBlank ¶
FirstNonBlank returns the first element in the given list of elements that is not empty, null, or whitespace only. If all the elements are blank or the list is null or empty, null is returned.
func FirstNonEmpty ¶
FirstNonEmpty returns the first element in a given list of elements that is not empty. If all the elements are null or empty then null is returned.
func GetCommonPrefix ¶
GetCommonPrefix compares all strings in an array of strings and returns the common starting character sequence that all of them share.
func GetDigits ¶
GetDigits checks for Unicode digits in a string and returns a new string that contains all the digits in the given string. If the given string does not contain any digits, an empty string will be returned.
func GetIfBlank ¶
GetIfBlank is used to call the function and get the data if the provided string is blank.
A string is considered to be blank if it satisfied one of the criteria below. Length of string is 0. String contains only whitespace characters.
func GetIfEmpty ¶
GetIfEmpty is used to call the function and get the data if the provided string is empty.
func IndexOf ¶
IndexOf is used to get the index of the first occurrence of the given character. If the character is not found, then it will return -1.
func IndexOfAny ¶
IndexOfAny is used to get the index of the first occurrence of one of the given characters. If the character is not found, then it will return -1.
func IndexOfAnyBut ¶
IndexOfAnyBut is used to get the index of the first occurrence of any character other than one of the given characters. If the character is not found, then it will return -1.
func IndexOfAnyButIgnoreCase ¶
IndexOfAnyButIgnoreCase is used to get the index of the first occurrence of any character other than one of the given characters ignoring case. If the character is not found, then it will return -1.
func IndexOfAnyIgnoreCase ¶
IndexOfAnyIgnoreCase is used to get the index of the first occurrence of one of the given characters ignoring case. If the character is not found, then it will return -1.
func IndexOfDifference ¶
IndexOfDifference figures out the index of the first character sequence that differs from the given sequence. The comparison of the character sequences in the given text is case-sensitive.
func IndexOfIgnoreCase ¶
IndexOfIgnoreCase is used to get the index of the first occurrence of the given character ignoring case. If the character is not found, then it will return -1.
func IndexOfString ¶
IndexOfString is used to get the index of the first occurrence of the given string. If the character is not found, then it will return -1.
func IndexOfStringIgnoreCase ¶
IndexOfStringIgnoreCase is used to get the index of the first occurrence of the given string ignoring case. If the string is not found, then it will return -1.
func IndexOfStringStartingAt ¶
IndexOfStringStartingAt is used to get the index of the first occurrence of the given string starting with index provided. If the character is not found, then it will return -1.
func IsAllBlank ¶
IsAllBlank is used to check if the all the given strings are blank.
A string is considered to be blank if it satisfied one of the criteria below. Length of string is 0. String contains only whitespace characters.
func IsAllEmpty ¶
IsAllEmpty is used to check if the all the given strings are empty.
func IsAllLowerCase ¶
IsAllLowerCase is used to check if all characters in the all the given strings is in lower case.
func IsAllMixedCase ¶
IsAllMixedCase is used to check if all the given strings contain both upper and lower case characters.
func IsAllUpperCase ¶
IsAllUpperCase is used to check if all characters in the all the given strings is in upper case.
func IsAlpha ¶
IsAlpha checks whether a given string contains only letters. The function returns false if the input string is empty.
func IsAlphaNumeric ¶
IsAlphaNumeric checks whether a given string contains only letters or digits. The function returns false if the input string is empty.
func IsAlphaNumericSpace ¶
IsAlphaNumericSpace checks whether a given string contains only letters or digits or space. The function returns false if the input string is empty.
func IsAlphaSpace ¶
IsAlphaSpace checks whether a given string contains only letters or space. The function returns false if the input string is empty.
func IsAnyBlank ¶
IsAnyBlank is used to check if any of the given strings is blank or not.
A string is considered to be blank if it satisfied one of the criteria below. Length of string is 0. String contains only whitespace characters.
func IsAnyEmpty ¶
IsAnyEmpty is used to check if any of the given strings is empty or not.
func IsAnyLowerCase ¶
IsAnyLowerCase is used to check if all characters in any of the given strings is in lower case.
func IsAnyMixedCase ¶
IsAnyMixedCase is used to check if any of the given strings contain both upper and lower case characters.
func IsAnyUpperCase ¶
IsAnyUpperCase is used to check if all characters in any of the given strings is in upper case.
func IsAsciiPrintable ¶
IsAsciiPrintable is used to check if the given string contains only ASCII characters that are printable.
func IsBlank ¶
IsBlank is used to check if the given string is blank.
A string is considered to be blank if it satisfied one of the criteria below. Length of string is 0. String contains only whitespace characters.
func IsLowerCase ¶
IsLowerCase is used to check if all characters in the string is in lower case.
func IsMixedCase ¶
IsMixedCase is used to check if it contains both upper and lower case characters.
func IsNoneBlank ¶
IsNoneBlank is used to check if none of the given strings are blank.
A string is considered to be blank if it satisfied one of the criteria below. Length of string is 0. String contains only whitespace characters.
func IsNoneEmpty ¶
IsNoneEmpty is used to check if none of the given strings are empty.
func IsNumeric ¶
IsNumeric checks whether a given string contains only digits. The function returns false if the input string is empty.
func IsNumericSpace ¶
IsNumericSpace checks whether a given string contains only digits or space. The function returns false if the input string is empty.
func IsUpperCase ¶
IsUpperCase is used to check if all characters in the string is in upper case.
func JoinByChar ¶
JoinByChar is used to join the characters by a character.
func JoinStringersByChar ¶ added in v0.6.1
JoinStringersByChar is used to join the values converting them to string by stringer by a character.
func JoinStringersByString ¶ added in v0.6.1
JoinStringersByString is used to join the values converting them to string by stringer by a string.
func JoinStringsByChar ¶
JoinStringsByChar is used to join the strings by a character.
func JoinStringsByString ¶
JoinStringsByString is used to join the strings by a string.
func LastIndexOf ¶
LastIndexOf is used to get the index of the first occurrence of the given character. If the character is not found, then it will return -1.
func LastIndexOfAny ¶
LastIndexOfAny is used to get the index of the first occurrence of one of the given characters. If the character is not found, then it will return -1.
func LastIndexOfAnyBut ¶
LastIndexOfAnyBut is used to get the index of the first occurrence of any character other than one of the given characters. If the character is not found, then it will return -1.
func LastIndexOfAnyButIgnoreCase ¶
LastIndexOfAnyButIgnoreCase is used to get the index of the first occurrence of any character other than one of the given characters ignoring case. If the character is not found, then it will return -1.
func LastIndexOfAnyIgnoreCase ¶
LastIndexOfAnyIgnoreCase is used to get the index of the first occurrence of one of the given characters ignoring case. If the character is not found, then it will return -1.
func LastIndexOfIgnoreCase ¶
LastIndexOfIgnoreCase is used to get the index of the first occurrence of the given character ignoring case. If the character is not found, then it will return -1.
func LastIndexOfString ¶
LastIndexOfString is used to get the index of the first occurrence of the given string. If the character is not found, then it will return -1.
func LastIndexOfStringIgnoreCase ¶
LastIndexOfStringIgnoreCase is used to get the index of the first occurrence of the given string ignoring case. If the string is not found, then it will return -1.
func LeftPadString ¶
LeftPadString is used to left pad the given string to the given string.
func Mid ¶
Mid is used to return the string starting from the given position index upto the given length.
func NormalizeSpace ¶
NormalizeSpace is used to return the whitespace normalized string by removing the leading and trailing whitespace and then replacing sequences of whitespace characters with a single space.
func OrdinalIndexOf ¶
OrdinalIndexOf is used to return the index of the nth occurrence of the search string in the given string
func Overlay ¶
Overlay overlays part of a String with another String. A negative index is treated as zero. An index greater than the string length is treated as the string length. The start index is always the smaller of the two indices.
func PrependIfMissing ¶
PrependIfMissing is used to prepend a given prefix at the start of a string if it does not already start with one on the given list.
func PrependIfMissingIgnoreCase ¶
PrependIfMissingIgnoreCase is used to prepend a given prefix at the start of a string if it does not already start with one on the given list ignoring case.
func RemoveEnd ¶
RemoveEnd is used to remove the occurrence of the given string from the given string's end
func RemoveEndIgnoreCase ¶
RemoveEndIgnoreCase is used to remove the occurrence of the given string from the given string's end ignoring case
func RemoveIgnoreCase ¶
RemoveIgnoreCase is used to remove all occurrences of a given character in the string ignoring case
func RemoveStart ¶
RemoveStart is used to remove the occurrence of the given string from the given string's start
func RemoveStartIgnoreCase ¶
RemoveStartIgnoreCase is used to remove the occurrence of the given string's start from the given string ignoring case
func RemoveString ¶
RemoveString is used to remove all occurrences of a given string in the string
func RemoveStringIgnoreCase ¶
RemoveStringIgnoreCase is used to remove all occurrences of a given string in the string ignoring case
func RepeatString ¶
RepeatString is used to repeat the given string the given number of times.
func RepeatStringWithSeparator ¶
RepeatStringWithSeparator is used to repeat the given string the given number of times each separated by the given separator.
func Replace ¶
Replace is used to replace the given number of occurrences of a string in the given string with another string.
func ReplaceAll ¶
ReplaceAll is used to replace all occurrences of a string in the given string with another string.
func ReplaceEach ¶
ReplaceEach is used to replace each of the characters in the search list with the corresponding character in the replacement list exactly once.
func ReplaceIgnoreCase ¶
ReplaceIgnoreCase is used to replace the given number of occurrences of a string in the given string with another string ignoring case.
func ReverseDelimited ¶
ReverseDelimited is used to reverse the given string split by the delimiter
func RightPadString ¶
RightPadString is used to right pad the given string to the given string.
func SplitByString ¶
SplitByString is used to split the string by the separator provided
func SplitByStringWithTrim ¶
SplitByStringWithTrim is used to split the string by the separator provided and trim the splits
func SplitByStringWithTrimCutSet ¶
SplitByStringWithTrimCutSet is used to split the string by the separator provided and trailing Unicode code points contained in cut set removed.
func SplitN ¶
SplitN slices s into substrings separated by sep and returns a slice of the substrings between those separators.
The count determines the number of substrings to return:
n > 0: at most n substrings; the last substring will be the remainder which won't be split. n == 0: the result is nil (zero substrings) n < 0: all substrings
Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for Split.
func SplitNByString ¶
SplitNByString slices s into substrings separated by sep and returns a slice of the substrings between those separators.
The count determines the number of substrings to return:
n > 0: at most n substrings; the last substring will be the remainder which won't be split. n == 0: the result is nil (zero substrings) n < 0: all substrings
Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for Split.
func SplitNByStringWithTrim ¶
SplitNByStringWithTrim slices s into substrings separated by sep and returns a slice of the substrings between those separators and along with that trim the splits.
The count determines the number of substrings to return:
n > 0: at most n substrings; the last substring will be the remainder which won't be split. n == 0: the result is nil (zero substrings) n < 0: all substrings
Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for Split.
func SplitNByStringWithTrimCutSet ¶
SplitNByStringWithTrimCutSet slices s into substrings separated by sep and returns a slice of the substrings between those separators and trailing Unicode code points contained in cut set removed.
The count determines the number of substrings to return:
n > 0: at most n substrings; the last substring will be the remainder which won't be split. n == 0: the result is nil (zero substrings) n < 0: all substrings
Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for Split.
func SplitNWithTrim ¶
SplitNWithTrim slices s into substrings separated by sep and returns a slice of the substrings between those separators and along with that trim the splits.
The count determines the number of substrings to return:
n > 0: at most n substrings; the last substring will be the remainder which won't be split. n == 0: the result is nil (zero substrings) n < 0: all substrings
Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for Split.
func SplitNWithTrimCutSet ¶
SplitNWithTrimCutSet slices s into substrings separated by sep and returns a slice of the substrings between those separators and trailing Unicode code points contained in cut set removed.
The count determines the number of substrings to return:
n > 0: at most n substrings; the last substring will be the remainder which won't be split. n == 0: the result is nil (zero substrings) n < 0: all substrings
Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for Split.
func SplitWithTrim ¶
SplitWithTrim is used to split and trim the splits
func SplitWithTrimCutSet ¶
SplitWithTrimCutSet is used to split and trailing Unicode code points contained in cut set removed.
func StartsWith ¶
StartsWith is used to check if the provided prefix is present at the beginning of the string or not.
func StartsWithAny ¶
StartsWithAny is used to check if any of the provided prefixes is present at the beginning of the string or not.
func StartsWithAnyIgnoreCase ¶
StartsWithAnyIgnoreCase is used to check if any of the provided prefixes is present at the beginning of the string or not ignoring case.
func StartsWithIgnoreCase ¶
StartsWithIgnoreCase is used to check if the provided prefix is present at the beginning of the string or not ignoring case.
func Strip ¶
Strip is used to remove the given set of characters from the starting and ending of the string
func StripAll ¶
StripAll is used to remove the given set of characters from the starting and ending of the given list of strings
func StripAllEnd ¶
StripAllEnd is used to remove the given set of characters from the ending of the given list of strings
func StripAllStart ¶
StripAllStart is used to remove the given set of characters from the starting of the given list of strings
func StripEnd ¶
StripEnd is used to remove the given set of characters from the ending of the string
func StripStart ¶
StripStart is used to remove the given set of characters from the starting of the string
func Substring ¶
Substring returns the string between the given start(inclusive) and the end(exclusive) index.
func SubstringAfter ¶
SubstringAfter returns the string after the first occurrence of the separator in the string.
func SubstringAfterLast ¶
SubstringAfterLast returns the string after the last occurrence of the separator in the string.
func SubstringAfterLastString ¶
SubstringAfterLastString returns the string after the last occurrence of the separator in the string.
func SubstringAfterString ¶
SubstringAfterString returns the string after the first occurrence of the separator in the string.
func SubstringBefore ¶
SubstringBefore returns the string after the first occurrence of the separator in the string.
func SubstringBeforeLast ¶
SubstringBeforeLast returns the string after the last occurrence of the separator in the string.
func SubstringBeforeLastString ¶
SubstringBeforeLastString returns the string after the last occurrence of the separator in the string.
func SubstringBeforeString ¶
SubstringBeforeString returns the string after the first occurrence of the separator in the string.
func SubstringTillEnd ¶
SubstringTillEnd returns the string from the given start index till the end of the string.
func SwapCase ¶
SwapCase is used to change the case of lower case characters to upper case and vice-versa.
func ToCodePoints ¶
ToCodePoints returns the unicode code point for the characters of the string.
func Trim ¶
Trim returns a slice of the string s with all leading and trailing Unicode code points contained in cut set removed.
func TrimLeft ¶
TrimLeft returns a slice of the string s with all leading Unicode code points contained in cut set removed.
To remove a prefix, use TrimPrefix instead.
func TrimPrefix ¶
TrimPrefix returns s without the provided leading prefix string. If s doesn't start with prefix, s is returned unchanged.
func TrimRight ¶
TrimRight returns a slice of the string s, with all trailing Unicode code points contained in cut-set removed.
To remove a suffix, use TrimSuffix instead.
func TrimSpace ¶
TrimSpace returns a slice of the string s, with all leading and trailing white space removed, as defined by Unicode.
func TrimSuffix ¶
TrimSuffix returns s without the provided trailing suffix string. If s doesn't end with suffix, s is returned unchanged.
func Truncate ¶
Truncate is used to return the substring of the string starting from the offset position and having a width <= max width.
func TruncateFromStart ¶
TruncateFromStart is used to return the substring of the string starting from the beginning and having a width <= max width.
func Uncapitalize ¶
Uncapitalize used to convert the first character of the given string to lower case. The remaining characters of the string are not changed.
Types ¶
This section is empty.