Question: how to find the difference between two strings?
Answer: To find the difference between 2 Strings you can use StringUtils class and the difference method. It compares the two Strings, and returns the portion where they differ. Without iterating through the strings you can only know that they are different, not where - and that only if they are of different length.