I have an array that is created dynamically depending on different parameters. Its items can be (e.g.) Item(0) = Colorado or Item(0) = Arkansas, Item(1) = Utah or Item(0) = Utah, Item(1) = Colorado, Item(2) = Arkansas. But every string occurs only once, so Item(0) = Colorado, Item(1) = Colorado is not possible.
What I try to get is an array with the shortversions of the statenames
Example:
Starting Array: Item(0) = Colorado, Item(1) = Arkansas
New Array: Item(0) = Col, Item(1) = Ark
So, I need to store information as follows:
|Shortversion| Fullversion |
|:-----------|------------:|
| Col | Colorado |
| Ark | Arkansas |
| Uth | Utah |
So I was looking for a possibiltiy to store the information and get the full state names into another array.
I accomplished that by creating a datatable with the information. For each arrayelement I could find the shorthand version and return the fullname. But that is not a 'performance-oriented' solution. Could anyone help me finding a solution that has a better performance?