Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

17. Two string methods find where a character is in a string: find and index. (a) Both work the same if a character is

 

17. Two string methods find where a character is in a string: find and index. (a) Both work the same if a character is found, but behave differently if the character is not found. Describe the difference in how they behave when the character is not found. (b) The find and index methods are not limited to finding single characters. They can search for substrings. Given s= "Topkapi", what does s. find ("kap") print? Describe the rule for what find prints.

Step by Step Solution

3.42 Rating (146 Votes )

There are 3 Steps involved in it

Step: 1

a The find method returns the lowest index in the string where the ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Project Management The Managerial Process

Authors: Eric W Larson, Clifford F. Gray

8th Edition

1260570436, 978-1260570434

More Books

Students also viewed these Programming questions