Read the API doc for the indexOf() method. It's all there.