12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package strutils
- import (
- uuid "github.com/satori/go.uuid"
- "strings"
- )
- func AllBlank(str ...string) bool {
- for _, s := range str {
- if !IsStringEmpty(s) {
- return false
- }
- }
- return true
- }
- func HasBlank(str ...string) bool {
- for _, s := range str {
- if strings.Trim(s, " ") == "" {
- return true
- }
- }
- return false
- }
- func HasText(str ...string) bool {
- for _, s := range str {
- if strings.Trim(s, " ") != "" {
- return true
- }
- }
- return false
- }
- func IsStringEmpty(s string) bool {
- return strings.Trim(s, " ") == ""
- }
- func IsStringNotEmpty(s string) bool {
- return strings.Trim(s, " ") != ""
- }
- func GetUUID() string {
- return uuid.NewV4().String()
- }
- func SimpleUUID() string {
- return strings.ReplaceAll(GetUUID(), "-", "")
- }
|