Question: A useful member function of the string class is find. The call str . find ( ch ) returns the position of the first occurrence
A useful member function of the string class is find. The call strfindch returns the position of the first occurrence of ch in str or the "special" value, string::npos if there is no match. We could have implemented the firstspace function as return strfind However, that function is not useful if we have alternatives, such as "any vowel".
Implement a function that uses the find member function and finds the first position of any characters from a set in a given string. For example, firstinsetspring "aeiou" returns because i occurs in the set "aeiou" and the preceding characters do not.
If there is no match, then return
Use multiple return statements. As soon as you have computed the answer, return it
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
