I'm trying to see if a string contains a specific character in it. For example, given the text file:
I am going to the store.
I will be at <area>.
I need to buy <item>.
I'm trying to have my program scan the text line-by-line and detect any instance of "<" and ">". That way it can remove these and prompt the user for an "area" or "item" in the console. The current block of code I have is as follows:
Scanner sc = new Scanner(f);
while(sc.hasNextLine()) {
String info = sc.nextLine();
if(info.contains('<')) /// this is where I am stuck! Contains() doesn't seem to work on a single char
}