Skip to content

Instantly share code, notes, and snippets.

@Ivan-Feofanov
Created November 28, 2018 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ivan-Feofanov/573cf607ed5c05b306d4497037558dd7 to your computer and use it in GitHub Desktop.
Save Ivan-Feofanov/573cf607ed5c05b306d4497037558dd7 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"regexp"
)
func main(){
phone := "+1 (567) 222-55-44"
reg := regexp.MustCompile(`\D`)
phone = reg.ReplaceAllString(phone, "")
fmt.Println(phone) // 15672225544
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment