I want to ask the users a couple of questions and then contact an API. The issue is, I will ask them for city names, and the API needs it to be in a specific format, for example SYD for Sydney, NYC for New York, etc.
How can I format the city names before sending it to the API? City names should match the names from this list
https://www.iata.org/en/publications/store/airline-coding-directory/