Find the answer to your question
I am seeing data in varying formats in the StateOrProvince field in a ShippingAddress. Is there a standard format that we should expect? How do I handle the data?
The StateOrProvince field in a user's address has legacy data from the time it was free form text entry field. It can also come from PayPal addresses which at one time were free form text fields.
Therefore we cannot guarantee that it will meet any single format or sets of formats.
You should see very few variations other than the 2 character abbreviation of a State or the full name of a State ... mixed case being a possibility ... you may also see substrings such as Calif. This makes it difficult since some substrings such as Ala can match more than 1 state.
What we suggest for addresses is to check the Zip code and do a lookup on zip code to find the state where the zip code resides in if you cannot do a successful match on either the 2 letter abbreviation or the full name.
Checking the Zip Code is also a sanity check for substring matches that match more than 1 state.