Table of contents
METHOD | RETURN | DESCRIPTION |
---|---|---|
getInvalidMessage (phoneNumber, countryCode) | Returns reason when validation not passed | |
isValid (phoneNumber, countryCode) | boolean
|
Tests whether a phone number matches a valid pattern |
Returns reason when validation not passed.
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
phoneNumber |
String
|
The phone number in string |
countryCode |
String
|
ISO 3166-1 two-letter country code. Region that we are expecting the number to be from. This is only used if the number being parsed is not written in international format. |
Tests whether a phone number matches a valid pattern.
Return: boolean
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
phoneNumber |
String
|
The phone number in string |
countryCode |
String
|
ISO 3166-1 two-letter country code. Region that we are expecting the number to be from. This is only used if the number being parsed is not written in international format. |