Skip to content
Snippets Groups Projects
Commit 542e4c81 authored by Francé Wilke's avatar Francé Wilke
Browse files

StandardisePhoneNumber to trim space and check for empty string

parent 48168e52
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,12 @@ func IsNumericString(s string) bool {
// StandardisePhoneNumber standardises phone numbers with +27 instead of 0 prefix
func StandardisePhoneNumber(number string) string {
number = strings.TrimSpace(number)
if number == "" {
return number
}
// is the first rune/char of the string a 0
if []rune(number)[0] == []rune("0")[0] {
// Add south african country code (hardcoded for now)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment