String Methods

AP Computer Science A· difficulty 3/5

<code>"abcdefg".indexOf("de")</code> returns

  • A

    4

  • B

    2

  • C

    −1

  • D

    3

    check_circle

Explanation

First match starts at index 3.

Want 10 more like this — adaptive to your weak spots?

Related questions