The if statement does not read the string in the array - tokens[i] so the condition after if does not execute. The string "hot" can not be read. Why is that so? Please help! Thanks.
public static void main(String[] args){
String str = "Wow! It's getting realy hot in here." ;
String delims = "[ .,?!/><;:'_!`~/$/@/#/%/&/|/[/]/{/}/)/(]+";
String[] tokens = str.split(delims);
for (int i = 0; i < tokens.length; i++){
if (tokens[i] == "hot"){
System.out.println("Found!");
break;
}
else {
System.out.println("Not found!");
}
}
}