💻ap computer science a review

IndexOf

Written by the Fiveable Content Team • Last updated August 2025
Verified for the 2027 exam
Verified for the 2027 examWritten by the Fiveable Content Team • Last updated August 2025

Definition

A String method that returns the index of the first occurrence of a specified substring within a string, or -1 if not found; used for string comparison and searching.

AP course connection

Topic 1.15: 1.15 String Methods

Unit 1

"IndexOf" also found in: