Hi,
in the C# implementation, it's somethink like:
try {
let _phone = new PhoneNumber.PhoneNumberUtil();
const _n = _phone.parse(number, "");
const countryCode = _phone.getRegionCodeForNumber(_n);
console.log(countryCode);
} catch (error) {
console.log(error);
throw error;
}
I hope this helps you.
Best regards.
Marcos Porto.