Question: Given string workStr on one line, string newStr on a second line, and string strSelection on a third line, insert the contents of newStr in

Given string workStr on one line, string newStr on a second line, and string strSelection on a third line, insert the contents of newStr in workStr right before the first occurrence of strSelection.
Ex: If the input is:
FuzzyBear
Wuzzy
Be
then the output is:
FuzzyWuzzyBear #include
#include
using namespace std;
int main(){
string workStr;
string newStr;
string strSelection;
getline(cin, workStr);
getline(cin, newStr);
getline(cin, strSelection);
/* Your code goes here */
cout << workStr << endl;
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!