Documentation
¶
Overview ¶
Package str @Description:
Index ¶
- func After(subject string, search string) string
- func AfterLast(subject string, search string) string
- func Before(subject string, search string) string
- func BeforeLast(subject string, search string) string
- func Between(subject string, from string, to string) string
- func BetweenFirst(subject string, from string, to string) string
- func Camel(value string) (response string)
- func Contains(haystack string, needles string, ignoreCase bool) bool
- func ContainsAll(haystack string, needles []string, ignoreCase bool) bool
- func ContainsAny(haystack string, needles []string, ignoreCase bool) bool
- func E(value string) string
- func EndsWith(haystack string, needles string) bool
- func Excerpt(text string, phrase string, options map[string]string) (response string)
- func Finish(value string, cap string) string
- func Headline(value string) (response string)
- func Is(pattern string, value string) bool
- func IsAscii(value string) bool
- func Kebab(value string) (response string)
- func LcFirst(value string) string
- func Length(value string) int
- func Limit(value string, limit int, end string) string
- func Lower(value string) string
- func Mask(subject string, character string, index int, length int) string
- func PadBoth(value string, length int, pad string) (response string)
- func PadLeft(value string, length int, pad string) string
- func PadRight(value string, length int, pad string) string
- func Random(length int) string
- func RegularReplaceArray(pattern string, replacements []string, subject string) string
- func Remove(search string, subject string, caseSensitive bool) (response string)
- func Replace(search string, replace string, subject string) string
- func ReplaceArray(search string, replace []string, subject string) string
- func ReplaceFirst(search string, replace string, subject string) string
- func ReplaceLast(search string, replace string, subject string) string
- func ReplaceOfArraySearch(search []string, replace string, subject string) (response string)
- func Reverse(value string) string
- func Snake(value string) (response string)
- func SnakeOfCustom(value string, delimiter string) (response string)
- func Start(value string, prefix string) string
- func StartsWith(haystack string, needles string) bool
- func Studly(value string) (response string)
- func Substr(subject string, start int, length int) string
- func SubstrCount(haystack string, needle string) int
- func SubstrReplace(subject string, replace string, offset int, length int) string
- func Swap(swapMap map[string]string, subject string) string
- func UcFirst(value string) string
- func Upper(value string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func After ¶
After @Description:Return the remainder of a string after the first occurrence of a given value. @param subject @param search @return string
func AfterLast ¶
AfterLast @Description:Return the remainder of a string after the last occurrence of a given value. @param subject @param search @return string
func Before ¶
Before @Description:Get the portion of a string before the first occurrence of a given value. @param subject @param search @return string
func BeforeLast ¶
BeforeLast @Description:Get the portion of a string before the last occurrence of a given value. @param subject @param search @return string
func Between ¶
Between @Description:Get the portion of a string between two given values. @param subject @param from @param to @return string
func BetweenFirst ¶
BetweenFirst @Description:Get the smallest possible portion of a string between two given values. @param subject @param from @param to @return string
func Contains ¶
Contains @Description:Determine if a given string contains a given substring. @param haystack @param needles @param ignoreCase @return bool
func ContainsAll ¶
ContainsAll @Description:Determine if a given string contains all array values. @param haystack @param needles @param ignoreCase @return bool
func ContainsAny ¶
ContainsAny @Description:Determine if a given string contains any one in array values. @param haystack @param needles @param ignoreCase @return bool
func EndsWith ¶
EndsWith @Description: Determine if a given string ends with a given substring. @param haystack @param needles @return bool
func Excerpt ¶
Excerpt @Description: Extracts an excerpt from text that matches the first instance of a phrase. @param text @param phrase @param options @return response
func Finish ¶
Finish @Description:Cap a string with a single instance of a given value. @param value @param cap @return string
func Headline ¶
Headline @Description: Convert the given string to title case for each word. @param value @return response
func Is ¶
Is @Description:Determine if a given string matches a given pattern. @param pattern @param value @return bool
func IsAscii ¶
IsAscii @Description:Determine if a given string is 7 bit ASCII. @param value @return bool
func LcFirst ¶
LcFirst @Description: Make a string's first character lowercase. @param value @return string
func Limit ¶
Limit @Description: the number of characters in a string. @param value @param limit @param end @return string
func Mask ¶
Mask @Description: Masks a portion of a string with a repeated character. @param subject @param character @param index @param length @return string
func PadBoth ¶
PadBoth @Description: Pad both sides of a string with another. @param value @param length @param pad @return response
func PadLeft ¶
PadLeft @Description:Pad the left side of a string with another. @param value @param length @param pad @return string
func PadRight ¶
PadRight @Description:Pad the right side of a string with another. @param value @param length @param pad @return string
func Random ¶
Random @Description:Generate a more truly "random" alpha-numeric string. @param length @return string
func RegularReplaceArray ¶
RegularReplaceArray @Description: Replace a given pattern with each value in the array in sequentially. @param pattern @param replacements @param subject @return string
func Remove ¶
Remove @Description:Remove any occurrence of the given string in the subject. @param search @param subject @param caseSensitive @return string
func Replace ¶
Replace @Description:the given value in the given string @param search @param replace @param subject
func ReplaceArray ¶
ReplaceArray @Description: Replace a given value in the string sequentially with an array. @param search @param replace @param subject @return string
func ReplaceFirst ¶
ReplaceFirst @Description:Replace the first occurrence of a given value in the string. @param search @param replace @param subject @return string
func ReplaceLast ¶
ReplaceLast @Description:Replace the last occurrence of a given value in the string. @param search @param replace @param subject @return string
func ReplaceOfArraySearch ¶
ReplaceOfArraySearch @Description:replace the given array value in the given string. @param search @param replace @param subject @return response
func SnakeOfCustom ¶
SnakeOfCustom @Description: Convert a string to kebab case. @param value @param delimiter @return response
func Start ¶
Start @Description:Begin a string with a single instance of a given value. @param value @param prefix @return string
func StartsWith ¶
StartsWith @Description:Determine if a given string starts with a given substring. @param haystack @param needles @return bool
func Substr ¶
Substr @Description:Returns the portion of the string specified by the start and length parameters. @param subject @param start @param length @return string
func SubstrCount ¶
SubstrCount @Description: Returns the number of substring occurrences. @param haystack @param needle @return int
func SubstrReplace ¶
SubstrReplace @Description:Replace text within a portion of a string. @param subject @param replace @param offset @param length @return string
func Swap ¶
Swap @Description: Swap multiple keywords in a string with other keywords. @param swapMap @param subject @return string
Types ¶
This section is empty.