Documentation ¶
Index ¶
- func DefaultIfBlank(str, def string) string
- func EncodePassword(rawPassword string) string
- func Equals(a, b string) bool
- func EqualsIgnoreCase(a, b string) bool
- func GetRandomStr(length int) string
- func IsAnyBlank(strs ...string) bool
- func IsBlank(str string) bool
- func IsEmpty(str string) bool
- func IsNotBlank(str string) bool
- func IsNotEmpty(str string) bool
- func IsPalindrome(s string) bool
- func IsPalindrome2(s string) bool
- func IsPalindrome3(s string) bool
- func LongestPalindromes(s string) string
- func RuneAt(s string, n int) rune
- func RuneFirstAt(s string) rune
- func RuneLastAt(s string) rune
- func RuneLen(s string) int
- func StringsJoin(strs ...string) string
- func SubStr(s string, start, length int) string
- func SubStrLen(s string, start, length int) string
- func ToCamel(str string) string
- func ToCamelLower(str string) string
- func ToCamelUpper(str string) string
- func ToInt(str string) int
- func ToInt64(str string) int64
- func ToInt64ByDefault(str string, def int64) int64
- func ToIntByDefault(str string, def int) int
- func ToUnderline(str string) string
- func ValidatePassword(encodePassword string, inputPassword string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultIfBlank ¶
func IsAnyBlank ¶
func IsBlank ¶
IsBlank checks if a string is whitespace or empty (""). Observe the following behavior:
goutils.IsBlank("") = true goutils.IsBlank(" ") = true goutils.IsBlank("bob") = false goutils.IsBlank(" bob ") = false
Parameter:
str - the string to check
Returns:
true - if the string is whitespace or empty ("")
func IsEmpty ¶
IsEmpty checks if a string is empty (""). Returns true if empty, and false otherwise.
func IsNotBlank ¶
func IsNotEmpty ¶
IsNotEmpty checks if a string is not empty (""). Returns false if not empty, and false otherwise
func IsPalindrome ¶
IsPalindrome 判断字符串是否是回文(reports whether s reads the same forward and backward)
func IsPalindrome2 ¶
func IsPalindrome3 ¶
IsPalindrome3 判断字符串是否是回文(reports whether s reads the same forward and backward) 忽略大小写和非字母 Letter case is ignored, as are non-letters.
func LongestPalindromes ¶
LongestPalindromes Longest Palindromic Substring 最长回文子串 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Example 2: Input: "cbbd" Output: "bb"
func ToInt64ByDefault ¶
ToInt64ByDefault 将字符串转换为int64 str: 字符串 def: 转化失败时候使用默认值
func ToIntByDefault ¶
ToIntByDefault 将字符串转换为int str: 字符串 def: 转化失败时候使用默认值
func ValidatePassword ¶
ValidatePassword
Types ¶
This section is empty.