How to convert CA into abbreviation state name

Hi All,

Please help me with this
My input string should be in short form that looks like CA
How can I convert CA into an abbreviation State name for example? CA for California, AK for Alaska.



Create one excel file with abbreviation and its corresponding state name. Then you can refer this file to get the state name based on given abbreviation.


An improvisation to this is retrieving abbreviation - state name from Wikipedia or any other stable web sites and search for the abbreviation.
In this sense, If there is any addition/change in the details, No need of manual update in the system.

You could use the attached code. Send InAbbreviation argument to provide the Abbreviation and get the State Name from the OutState argument.

StatesAbbreviation.xaml (15.5 KB)

Hope it helps.!

1 Like

Thank you UiJack, the code works perfectly.

I know this is super late, but another approach can be reading the abbreviations from an excel or fetching it from wikipedia, storing that data into a dictionary, and simply calling the dictionary for that state.