phone_number_from_string


Description:


[ Version ( replacement = "PhoneNumber.from_string" , since = "3.8" ) ]
public PhoneNumber phone_number_from_string (string phone_number, string? region_code) throws Error

Parses the string passed in phone_number.

Note that no validation is performed whether the recognized phone number is valid for a particular region.

The two-letter country code passed in region_code only is used if the phone_number is not written in international format. The application's default region as returned by phone_number_get_default_region is used if region_code is null.

If the number is guaranteed to start with a '+' followed by the country calling code, then "ZZ" can be passed for region_code.

Parameters:

phone_number

the phone number to parse

region_code

a two-letter country code, or null

Returns:

a new PhoneNumber instance on success, or null on error. Call free to release this instance.


Namespace: E