Extracting Country Code from Mobile Number in Azure B2C Custom Policy

I am currently working on an Azure B2C custom policy and I need to extract the country code from a user’s mobile number attribute (“mobilePhone”) in each user record. The mobile number is stored in the format “+852 91031201” (including the country code). My goal is to retrieve the country code separately for further processing.

I would like to know the best approach to achieve this within an Azure B2C custom policy. Are there any built-in functions or methods that can help me extract the country code from the mobile number attribute? If not, what would be the most efficient and reliable way to accomplish this task?

Leave a Comment