photoprism/pkg/txt/strings.go

17 lines
211 B
Go
Raw Normal View History

package txt
import (
2019-06-13 20:26:01 +02:00
"strings"
)
// Bool casts a string to bool.
func Bool(s string) bool {
s = strings.TrimSpace(s)
if s == "" || s == "0" || s == "false" || s == "no" {
return false
}
return true
}