isNumeric returns true if s is non-empty and all characters are digits.
(s string)
| 174 | |
| 175 | // isNumeric returns true if s is non-empty and all characters are digits. |
| 176 | func isNumeric(s string) bool { |
| 177 | if len(s) == 0 { |
| 178 | return false |
| 179 | } |
| 180 | for _, c := range s { |
| 181 | if c < '0' || c > '9' { |
| 182 | return false |
| 183 | } |
| 184 | } |
| 185 | return true |
| 186 | } |
| 187 | |
| 188 | // isAlpha returns true if s is non-empty and all characters are lowercase letters. |
| 189 | func isAlpha(s string) bool { |
no outgoing calls