I have some strings with equations in the following format ((a+b)/(c+(d*e))).
((a+b)/(c+(d*e)))
I also have a text file that contains the names of each variable, e.g.:
I'd make a hashMap mapping the variable names to the descriptions, then iterate through all the characters in the string and replace each occurrance of a recognised key with it's mapping. I would use a StringBuilder to build up the new string.