Checks if a string is lower case.
Use strings.ToLower()
to convert the string to lower case and compare it to the original string.
代码实现
import "strings"
func IsLower(s string) bool {
return strings.ToLower(s) == s
}
使用样例
IsUpper("go") // true
IsUpper("Go") // false