Extract code country from phone number [libphonenumber]

前端 未结 7 1777
情深已故
情深已故 2020-11-27 13:21

I have a string like this : +33123456789 (french phone number). I want to extract the country code (+33) without knowing the country. For example, it should work if i have a

7条回答
  •  醉梦人生
    2020-11-27 13:40

    If the string containing the phone number will always start this way (+33 or another country code) you should use regex to parse and get the country code and then use the library to get the country associated to the number.

提交回复
热议问题