Sorry for that. what i meant to say when i mentioned that it should load the whole sentence is this:
when i search for a word in the arraylist of sentences. it should display the sentences which contain the word being searched for.
thanks
Searching for a String in another String is easy:
-
String word= ...;
-
String sentence= ...;
-
boolean occurs= sentence.indexOf(word) >= 0;
-
If you can do that once you can do it for an entire List of sentences, but is
a 'sentence' just a line of text in a file or is a 'sentence' a linguistic sequence
of words, syntactically correct and ending with a punctuation character? Note
that sentences can span more than one line and more than one sentence can
be present on one line. If that is what you mean by a 'sentence' we have to
come up with a definition of what a 'sentence' actually is.
kind regards,
Jos