format.PhoneNumberParser
Note:
The content in this help topic pertains to SuiteScript 2.0.
Object Description |
The object that parses the string with the phone number to an object. |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Module |
|
Methods and Properties |
|
Since |
2020.2 |
Syntax
Important:
The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see N/format/i18n Module Script Samples.
// Add additional code
...
var pnParser = format.getPhoneNumberParser({
defaultCountry: format.Country.CZECH_REPUBLIC
});
var phoneNumber = pnParser.parse({
number: "602547854ext.154"
});
/* expected parsed output:
phoneNumber.countryCode = 420
phoneNumber.extension = 154
phoneNumber.nationalNumber = 602547854
phoneNumber.numberOfLeadingZeros = 1
phoneNumber.carrierCode = (blank)
phoneNumber.rawInput = 602547854ext.154
*/...
// Add additional code