diff --git a/string_util.go b/string_util.go index 03ac492..e91f655 100644 --- a/string_util.go +++ b/string_util.go @@ -2,6 +2,7 @@ package webutility import ( "fmt" + "strconv" "strings" ) @@ -70,11 +71,8 @@ func ReplaceAny(s, patern, r string) (n string) { } func StringToBool(s string) bool { - s = strings.ToLower(s) - if s == "true" { - return true - } - return false + res, _ := strconv.ParseBool(s) + return res } func BoolToString(b bool) string {