fromRaw static method
parses a phoneNumber
given a countryCode
Use parseWithIsoCode when possible as multiple countries use the same country calling code.
This assumes the phone number starts with the country calling code
throws a PhoneNumberException if the country calling code is invalid
Implementation
@internal
static PhoneNumber fromRaw(String phoneNumber) {
phoneNumber = TextParser.normalize(phoneNumber);
phoneNumber = InternationalPrefixParser.removeInternationalPrefix(
phoneNumber,
);
final countryCode = CountryCodeParser.extractCountryCode(phoneNumber);
return fromCountryCode(
countryCode, phoneNumber.substring(countryCode.length));
}