I'm having trouble making a loop or even if statement to search through an array and then if it returns the value of it, it displays it along with the word before and after.
For example:
String Criminals[] = {
"John Doe, Theft, 1990",
"Marry Al, Arson, 1970",
"Sal Don, Theft, 1961"
};
it searchs for theft and then it will get the name and date as well, and find the rest if there are any: and the output in this case would be:
Results (2):
John Doe, Theft, 1990
Sal Don, Theft, 1961
HashMap. You can specify its value and key to find it.