Reputation: 85
I have a file I'm reading through android. It is essentially just a list of words. I have an edit text where the user enters a word, and then I need to check if that word is in the list of words. I can get the file, I then add all the words to a String, and I can check if the characters of the word entered are located in the list of words, but I can't check if it's the word alone or not. For example, if the user enters 'bro' and bro is not in the word list, but 'brother' is, it returns true. The words are each on their own line, so I tried testing 'bro' as '\nbro\n', but that doesn't work. Any ideas? If you need code posted let me know, but I don't think it helps much
Upvotes: 1
Views: 296
Reputation: 85
I found what I was looking for. It was an unanswered question linked to at the bottom of the page. I needed to use a buffered reader to read the file, which allows for reading one line at a time. Thank you for your help. Using Buffered Reader
Upvotes: 1