I have a String that I need to search for in a collection of Strings. I'll need to do searches for multiple representations of the required String(original representation, trimmed, UTF-8 encoded, non ASCII characters encoded). The collection size will be in the order of thousands.
I'm trying to figure out what's the best representation to use for the collection in order to have the best performance:
- ArrayList - iterate over the array and check if any of the elements match any of the Strings representations
- HashMap - check if map contains any of my Strings representation
- Any other?