View Source AddressUS.Phone (AddressUS v0.4.2)
Summary
Functions
Removes non-numeric characters from the phone number and then returns the integer.
Removes country code and associated punctuation from the phone number.
Functions
Removes non-numeric characters from the phone number and then returns the integer.
Examples
iex> AddressUS.clean_phone_number("(303) 310-7802")
3033107802
Removes country code and associated punctuation from the phone number.
Examples
iex> AddressUS.filter_country_code("+1 303-310-7802")
"303-310-7802"
iex> AddressUS.filter_country_code("+1 (303) 310-7802")
"(303) 310-7802"
iex> AddressUS.filter_country_code("+1-303-310-7802")
"303-310-7802"
iex> AddressUS.filter_country_code("1-303-310-7802")
"303-310-7802"