on 2018 Sep 17 2:28 AM
Hello Experts,
Is there an OOTB service provided that I could use it to get the country code from the country's name?
For example, Great Britain -> GB
I have searched for the following service a lot however I always end up with the getIsoCode method for the currency.
Your help is highly appreciated!
Request clarification before answering.
Unfortunately We do not have any service Out of box to get country code from country name. You have to write your own.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
just a comment.
Maybe you have special / rare usecase, but generally it doesn't sound good to get isocode for String that is name of country. What if there is an misspelling in name of country? Take for example US, people can do it like that:
US
USA
United States of America
etc.
If this is not about human giving the value then better is to pass isocode everywhere and then translate to name when display. Also country name is not unique, can be empty (yes, it would be then data issue).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.