Documentation ¶
Index ¶
- Variables
- func Abbreviate(str, abbrevMarker string, offset, maxWidth int) (string, error)
- func Bytes(s string) []byte
- func CommonPrefix(strings ...string) string
- func Contains(s string, searchChar string) bool
- func ContainsAnySubstrings(s string, subs []string) bool
- func ContainsIgnoreCase(str, searchStr string) bool
- func DefaultIfBlank(str, defaultStr string) string
- func DefaultIfEmpty(str, defaultStr string) string
- func DeleteWhitespace(str string) string
- func Difference(a, b string) string
- func EndsWith(str, suffix string, ignoreCase bool) bool
- func EndsWithAny(sequence string, searchStrings ...string) bool
- func EndsWithCase(str, suffix string) bool
- func EndsWithIgnoreCase(str, suffix string) bool
- func Equals(str1, str2 string) bool
- func EqualsAny(str1 string, searchStrings ...string) bool
- func Index(s, substr string) int
- func IndexAny(s, chars string) int
- func IndexOfDifference(strings ...string) int
- func IndexOfDifferenceWithTwoStr(a, b string) int
- func IsAlpha(s string) bool
- func IsAlphanumeric(s string) bool
- func IsAnyBlank(strings ...string) bool
- func IsAnyEmpty(strings ...string) bool
- func IsBlank(s string) bool
- func IsEmpty(s string) bool
- func IsNoneBlank(strings ...string) bool
- func IsNoneEmpty(strings ...string) bool
- func IsNotBlank(s string) bool
- func IsNotEmpty(s string) bool
- func IsNumeric(s string) bool
- func IsNumerical(s string) bool
- func Left(str string, n int) string
- func Len(str string) int
- func MustReverse(s string) string
- func PadCenterChar(s string, size int, ch rune) string
- func PadCenterSpace(s string, size int) string
- func PadLeftChar(s string, size int, ch Char) string
- func PadLeftSpace(s string, size int) string
- func PadRightChar(s string, size int, ch rune) string
- func PadRightSpace(s string, size int) string
- func RegionMatches(str string, ignoreCase bool, thisStart int, substr string, start int, ...) bool
- func RemoveChar(s string, rmVal Char) string
- func RemoveString(s, rmStr string) string
- func RepeatChar(ch Char, repeat int) string
- func Reverse(s string) (string, error)
- func Right(str string, n int) string
- func Rotate(s string, shift int) string
- func Shuffle(s string) string
- func Sub(s string, start, end int) string
- func SubStart(s string, start int) string
- func Substring(str string, start int, end int) string
- func SubstringStart(str string, start int) string
- func Trim(s string, cutSet string) string
- func TrimAll(strings []string, stripChars string) []string
- func TrimLeft(str string, stripStr string) string
- func TrimRight(str string, stripStr string) string
- func TrimSpace(s string) string
- type Char
Constants ¶
This section is empty.
Variables ¶
var (
ErrDecodeChar = errors.New("error occurred on rune decoding")
)
Functions ¶
func CommonPrefix ¶
func ContainsAnySubstrings ¶
ContainsAnySubstrings returns whether s contains any of substring in slice.
func ContainsIgnoreCase ¶
func DefaultIfBlank ¶
func DefaultIfEmpty ¶
DefaultIfEmpty returns default String if str is empty.
func DeleteWhitespace ¶
func Difference ¶
func EndsWithAny ¶
func EndsWithCase ¶
func EndsWithIgnoreCase ¶
func IndexOfDifference ¶
IndexOfDifference 匹配字符传切片中的元素是否存在相同子串
func IsAlphanumeric ¶
IsAlphanumeric checks if the string contains only Unicode letters or digits.
func IsAnyBlank ¶
IsAnyBlank 判断字符串切片存在为空或长度为0或由空白符(whitespace) 构成的元素
func IsNoneBlank ¶
IsNoneBlank 判断字符串切片不存在为空或长度为0或由空白符(whitespace) 构成的元素
func IsNumeric ¶
IsNumeric Checks if the string contains only digits. A decimal point is not a digit and returns false.
func MustReverse ¶
MustReverse reverses a string, panics when error happens.
func PadCenterChar ¶
PadCenterChar center pad a string with a specified character in a larger string(specified size). if the size is less than the param string, the param string is returned. NOTE: size is unicode size.
func PadCenterSpace ¶
PadCenterSpace center pad a string with space character(' ') in a larger string(specified size). if the size is less than the param string, the param string is returned. note: size is unicode size.
func PadLeftChar ¶
PadLeftChar left pad a string with a specified character in a larger string (specified size). if the size is less than the param string, the param string is returned. NOTE: size is unicode size.
func PadLeftSpace ¶
PadLeftSpace left pad a string with space character(' ') in a larger string(specified size). if the size is less than the param string, the param string is returned. NOTE: size is unicode size.
func PadRightChar ¶
PadRightChar right pad a string with a specified character in a larger string(specified size). if the size is less than the param string, the param string is returned. NOTE: size is unicode size.
func PadRightSpace ¶
PadRightSpace right pad a string with space character(' ') in a large string(specified size). if the size is less than the param string, the param string is returned. NOTE: size is unicode size.
func RegionMatches ¶
func RemoveChar ¶
RemoveChar removes all occurrences of a specified character from the string.
func RemoveString ¶
RemoveString removes all occurrences of a substring from the string.
func RepeatChar ¶
RepeatChar returns padding using the specified delimiter repeated to a given length.
func Sub ¶
Sub returns substring from specified string avoiding panics with index start and end. start, end are based on unicode(utf8) count.
func SubStart ¶
SubStart returns substring from specified string avoiding panics with start. start, end are based on unicode(utf8) count.