I want to know if there is a way to compare a String to a text file to get the best possible answer. Example: We have a this in text file:
BANANA
BANTER
APPLE
BASKET
BASEBALL
and the current String is: B.N... (with the dots being the unknown characters). Is there a way to instantly get an array or hashmap with the possible letters (so A, T and E) out of the text file?
What I think I should do: I have managed to get every line of the text file in a arraylist. I should compare the current String to the possible answers in the arraylist and get every character in that word on the place of the dots and put it in a new arraylist.
Thanks in advance.