Documentation ¶
Index ¶
- Variables
- func Appends(value string, strs ...string) string
- func AppendsArray(value string, appends []string) string
- func At(value string, index int) string
- func Base64Decode(value string) string
- func Base64Encode(value string) string
- func Between(value string, start string, end string) ([]string, error)
- func Capitalize(value string) string
- func Chars(value string) ([]string, error)
- func CharsCount(invalue string) map[string]int
- func CollapseWhitespace(value string) string
- func Contains(value string, needle string, caseSensitive bool) bool
- func ContainsAll(value string, needles []string) bool
- func ContainsAllCaseSensitive(value string, needles []string, caseSensitive bool) bool
- func ContainsAny(value string, needles []string) bool
- func ContainsAnyCaseSensitive(value string, needles []string, caseSensitive bool) bool
- func CountSubstr(value string, substr string) int
- func CountSubstring(value string, substr string, caseSensitive bool, allowOverlapping bool) int
- func CountsSubstr(value string, substr string, allowOverlapping bool, count int) int
- func Dasherize(input string) string
- func DecEncode(value string) string
- func EndsWith(value string, search string) bool
- func EndsWithCase(value string, search string, caseSensitive bool) bool
- func EnsureLeft(value string, prefix string) string
- func EnsureLeftWithCase(value string, prefix string, caseSensitive bool) string
- func EnsureRight(value string, suffix string) string
- func EnsureRightWithCase(value string, suffix string, caseSensitive bool) string
- func First(value string) string
- func FirstNChars(value string, n int) string
- func Format(value string, params ...string) string
- func FormatNumber(number int64) string
- func HTMLDecode(encodedHTML string) string
- func HTMLEncode(plainHTML string) string
- func Head(value string) string
- func HexDecode(value string) string
- func HexEncode(value string) string
- func Humanize(input string) string
- func IndexOf(value string, needle string, caseSensitive bool) int
- func Insert(value string, substring string, index int) string
- func IsBlank(value string) bool
- func IsEnclosedBetween(value string, encloser string) bool
- func IsEnclosedBetweenTwo(value string, leftEncloser string, rightEncloser string) bool
- func IsLowerCase(value string) bool
- func IsString(value interface{}) bool
- func IsUpperCase(value string) bool
- func Join(strarr []string, separator string) string
- func Last(value string, n int) string
- func LastIndexOf(value string, needle string) int
- func LastIndexOfWithCase(value string, needle string, caseSensitive bool) int
- func LeftPad(value string, padStr string, pLen int) string
- func LeftPad2Len(value string, padStr string, overallLen int) string
- func LeftTrim(value string) string
- func Length(value string) int
- func Lines(input string) []string
- func LoadMapArrays()
- func LowerFirst(value string) string
- func Prepend(value string, prepends ...string) string
- func PrependArray(value string, prepends []string) string
- func RemoveEmptyStrings(stringsArr []string) ([]string, error)
- func RemoveLeft(value string, prefix string) string
- func RemoveLeftWithCase(value string, prefix string, caseSensitive bool) string
- func RemoveNonWords(value string) string
- func RemoveRight(value string, suffix string) string
- func RemoveRightWithCase(value string, suffix string, caseSensitive bool) string
- func RemoveSpaces(value string) string
- func Repeat(value string, multiplier int) string
- func Replace(value string, search string, newValue string, caseSensitive bool) string
- func Reverse(value string) string
- func RightPad(value string, pad string, length int) string
- func RightPad2Len(value string, padStr string, overallLen int) string
- func RightTrim(value string) string
- func SafeTruncate(value string, length int, filler string) string
- func Shuffle(value string) string
- func Slice(value string, begin int, end int) string
- func Slugify(value string) string
- func Split(value string, delimiterregex string) []string
- func Surround(value string, prefix string, suffix string) string
- func SwapCase(input string) string
- func Tail(value string) string
- func ToCamelCase(value string) string
- func ToDecamelize(value string, chr string) string
- func ToKebabCase(value string) string
- func ToSnakeCase(value string) string
- func ToStudlyCase(value string) string
- func Transliterate(value string) string
- func TrimEnd(value string, chars string) string
- func TrimEndSpaces(value string) string
- func TrimStart(value string, chars string) string
- func TrimStartSpaces(value string) string
- func Truncate(value string, length int, filler string) string
- func UnEqual(first string, second string) bool
- func Underscored(value string) string
- func UpperFirst(value string) string
- func Words(value string) []string
- func WordsDelimitedBy(value string, delimiter string) []string
- type StrTuple
Constants ¶
This section is empty.
Variables ¶
var Hm = make(map[string][]string)
Hm is an Ascii map
var (
// Version num of strman library
Version = "1.0.0"
)
Functions ¶
func AppendsArray ¶
AppendsArray an array of String to value
func At ¶
At :: Get the character at index. This method will take care of negative indexes. The valid value of index is between -(length-1) to (length-1). For values which don't fall under this range empty string will be returned.
func Base64Decode ¶
Base64Decode Decodes data encoded with MIME base64
func Base64Encode ¶
Base64Encode Encodes data with MIME base64.
func Capitalize ¶
Capitalize Converts the first character of string to upper case and the remaining to lower case.
func CharsCount ¶
CharsCount Counts the number of occurrences of each character in the string
func CollapseWhitespace ¶
CollapseWhitespace Replace consecutive whitespace characters with a single space.
func Contains ¶
Contains Verifies that the needle is contained in the value. The search is case sensitive
func ContainsAll ¶
ContainsAll Verifies that all needles are contained in value. The search is case insensitive needs refactoring
func ContainsAllCaseSensitive ¶
ContainsAllCaseSensitive Verifies that all needles are contained in value. The search is case sensitive
func ContainsAny ¶
ContainsAny Verifies that one or more of needles are contained in value. This is case insensitive
func ContainsAnyCaseSensitive ¶
ContainsAnyCaseSensitive Verifies that one or more of needles are contained in value.
func CountSubstr ¶
CountSubstr Count the number of times substr appears in value- Case Sensitive
func CountSubstring ¶
CountSubstring Count the number of times substr appears in value
func CountsSubstr ¶
CountsSubstr Counts the number of times substr appears in value
func EndsWithCase ¶
EndsWithCase Test if value ends with search. The search is case sensitive.
func EnsureLeft ¶
EnsureLeft Ensures that the value begins with prefix. If it doesn't exist, it's prepended. It is case sensitive.
func EnsureLeftWithCase ¶
EnsureLeftWithCase Ensures that the value begins with prefix. If it doesn't exist, it's prepended.
func EnsureRight ¶
EnsureRight Ensures that the value ends with suffix. If it doesn't, it's appended. This operation is case sensitive.
func EnsureRightWithCase ¶
EnsureRightWithCase Ensures that the value ends with suffix. If it doesn't, it's appended. This operation is case sensitive.
func FirstNChars ¶
FirstNChars Returns the first n chars of String(ASCII)
func FormatNumber ¶
FormatNumber Returns a string representation of the number passed in where groups of three digits are delimited by comma
func HTMLDecode ¶
HTMLDecode Converts all HTML entities to applicable characters. UnescapeString unescapes entities like "<" to become "<". á unescapes to "á"
func HTMLEncode ¶
HTMLEncode Convert all applicable characters to HTML entities. EscapeString escapes special characters like "<" to become "<" NOTE:: "á" doesnt return currently "á" but returns "á"
func Humanize ¶
Humanize Converts an underscored, camelized, or dasherized string into a humanized one. Also removes beginning and ending whitespace.
func IndexOf ¶
IndexOf The indexOf() method returns the index within the calling String of the first occurrence of the specified value, starting the search at fromIndex. Returns -1 if the value is not found.
func IsEnclosedBetween ¶
IsEnclosedBetween Verifies whether String is enclosed by same encloser
func IsEnclosedBetweenTwo ¶
IsEnclosedBetweenTwo Verifies whether String is enclosed by 2 different enclosers
func Join ¶
Join concatenates all the elements of the strings array into a single String. The separator string is placed between elements in the resulting string.
func LastIndexOf ¶
LastIndexOf returns the index within the calling String object of the last occurrence of the specified value Returns -1 if the value is not found. The search starts from the end and case sensitive.
func LastIndexOfWithCase ¶
LastIndexOfWithCase returns the index within the calling String object of the last occurrence of the specified value Returns -1 if the value is not found. The search starts from the end and case sensitive.
func LeftPad ¶
LeftPad Returns a new string of a given length such that the beginning of the string is padded.
func LeftPad2Len ¶
LeftPad2Len Left pad a string with padStr If the overallLen is shorter than the original string length the string will be shortened to this length (substr)
func LowerFirst ¶
LowerFirst Converts the first character of string to lower case.//
func PrependArray ¶
PrependArray Return a new String starting with prepends
func RemoveEmptyStrings ¶
RemoveEmptyStrings Remove empty Strings from string array
func RemoveLeft ¶
RemoveLeft Returns a new String with the prefix removed, if present. This is case sensitive.
func RemoveLeftWithCase ¶
RemoveLeftWithCase Returns a new String with the prefix removed, if present.
func RemoveNonWords ¶
RemoveNonWords Remove all non word characters. ACCENTED CHARS are removed including whitespace
func RemoveRight ¶
RemoveRight Returns a new string with the 'suffix' removed, if present. Search is case sensitive.
func RemoveRightWithCase ¶
RemoveRightWithCase Returns a new string with the 'suffix' removed, if present.
func Replace ¶
Replace Replace all occurrences of 'search' value to 'newvalue'. Uses ReplaceAllString method.
func RightPad ¶
RightPad Returns a new string of a given length such that the ending of the string is padded.
func RightPad2Len ¶
RightPad2Len Right pad a string with padStr If the overallLen is shorter than the original string length the string will be shortened to this length (substr)
func SafeTruncate ¶
SafeTruncate Truncate the string securely, not cutting a word in half. It always returns the last full word.
func SwapCase ¶
SwapCase Returns a copy of the string in which all the case-based characters have had their case swapped.
func ToDecamelize ¶
ToDecamelize Decamelize String
func Transliterate ¶
Transliterate Remove all non valid characters.
func TrimEndSpaces ¶
TrimEndSpaces Removes trailing whitespace from string.
func TrimStartSpaces ¶
TrimStartSpaces Removes leading whitespace from string.
func Truncate ¶
Truncate Truncates the unsecured form string, cutting the independent string of required position.
func Underscored ¶
Underscored Changes passed in string to all lower case and adds underscore between words.
func UpperFirst ¶
UpperFirst Converts the first character of string to upper case.
func WordsDelimitedBy ¶
WordsDelimitedBy Splits a String to words