View Source AddressUS.Phone (AddressUS v0.4.3)

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

Link to this function

clean_phone_number(phone)

View Source

Removes non-numeric characters from the phone number and then returns the integer.

Examples

iex> AddressUS.clean_phone_number("(303) 310-7802")
3033107802
Link to this function

filter_country_code(phone)

View Source

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"