PhoneNumberParser.parse(options)
Method Description |
Parses the string containing the phone number and returns the phone number object. If the input string contains the country code, it parses the given phone number. If the input string does not contain the country code, the country given to |
Returns |
Object |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Parent Object |
|
Methods and Properties |
|
Since |
2020.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
The string to be parsed. |
Syntax
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