You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
335 B

package istr
import (
4 years ago
"strconv"
4 years ago
"strings"
)
func SampleKeyInvalid(str string) bool {
idx := strings.IndexFunc(str, func(r rune) bool {
return r == '\t' ||
r == '\r' ||
r == '\n' ||
r == ',' ||
r == ' ' ||
r == '='
})
4 years ago
if idx != -1 {
return true
}
_, err := strconv.ParseFloat(str, 64)
return err == nil
}