Why the ">=0"?
Because indexOf() returns the offset from the beginning of the String to the searched for string. The searched for string could be at the start of the searched String, so offset would be 0. It could be somewhere else, so offset would be > 0. It could not exist, so offset would be -1.