如何从不包含国家代码的手机号码中获取国家代码或国家前缀


How to get country code or country prefix from a mobile number which doesn't contain country code

我正在研究一个应用程序,该应用程序可以使用或不使用国家代码拨打电话号码或发送短信。现在我想知道的是,是否有任何功能/模式可以检测不包含国家代码的数字的国家代码。

For example I have the number:
1. 0167-xxxx-xxx
2. 0171-xxxx-xxx
3. 3212-xxx-xxx
4. 4808-xxx-xxx

这里,前两个数字来自孟加拉国,后两个数字来自美国。那么,有没有办法从这些数字中确定/区分国家?

那么,有没有办法从这些数字中确定/区分国家?

不能,这就是为什么要使用国家代码。