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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user