diff --git a/op_string/tool.go b/op_string/tool.go index 886f099..17d7c14 100644 --- a/op_string/tool.go +++ b/op_string/tool.go @@ -152,3 +152,8 @@ func Random(length int, sourceCharList string) string { } return string(genStrByte) } + +// ValidateNotEmpty 验证字符串去前后空格之后不为空 +func ValidateNotEmpty(str string) bool { + return strings.TrimSpace(str) != "" +}