added IsPhoneNumber helper function to utils

This commit is contained in:
Bernhard B
2021-10-10 18:03:27 +02:00
parent 82fd577d48
commit 9fad77c922

View File

@@ -31,3 +31,18 @@ func StringInSlice(a string, list []string) bool {
}
return false
}
func IsPhoneNumber(s string) bool {
for index, c := range s {
if index == 0 {
if c != '+' {
return false
}
} else {
if c < '0' || c > '9' {
return false
}
}
}
return true
}