1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 06:32:28 +08:00

feat: add IsNotBlank func (#132)

Co-authored-by: yuanyou <yuanyou@kezaihui.com>
This commit is contained in:
elza
2023-09-13 15:29:26 +08:00
committed by GitHub
parent b698fec50f
commit f445ecbaf8
6 changed files with 119 additions and 0 deletions

View File

@@ -408,6 +408,11 @@ func IsBlank(str string) bool {
return true
}
// IsNotBlank checks if a string is not whitespace, not empty.
func IsNotBlank(str string) bool {
return !IsBlank(str)
}
// HasPrefixAny check if a string starts with any of a slice of specified strings.
// Play: https://go.dev/play/p/8UUTl2C5slo
func HasPrefixAny(str string, prefixes []string) bool {