indexOf() returns an int, please store in an int. Also, it should be const.