Sounds like you want to use a Map. The String would be the key to get a value from the Map.
value = theMap.get("a String");