19 lines
368 B
Go
19 lines
368 B
Go
package utils
|
|
|
|
import "strings"
|
|
|
|
// StringUtils 字符串工具类
|
|
type StringUtils struct{}
|
|
|
|
var Str = &StringUtils{}
|
|
|
|
// IsEmpty 判断字符串是否为空
|
|
func (s *StringUtils) IsEmpty(str string) bool {
|
|
return strings.TrimSpace(str) == ""
|
|
}
|
|
|
|
// IsNotEmpty 判断字符串是否非空
|
|
func (s *StringUtils) IsNotEmpty(str string) bool {
|
|
return !s.IsEmpty(str)
|
|
}
|