diff options
author | rsiddharth <s@ricketyspace.net> | 2020-09-05 19:05:50 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-09-05 19:05:50 -0400 |
commit | 2d9992587c8914050ba1f1f71345836c116ea14a (patch) | |
tree | 79c7ef804de959a4125bb3dfd22f42eb00f7e857 /lib | |
parent | 84cabad5fcf2224197526301ff82c08018eae7f5 (diff) |
lib: add isAlpha
* lib/str.go (isAlpha): New function.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/str.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -28,3 +28,13 @@ func stripSpaceChars(s string) string { } return ss } + +func isAlpha(c byte) bool { + switch { + case 'A' <= c && c <= 'Z': + return true + case 'a' <= c && c <= 'z': + return true + } + return false +} |