Question: abc is a string commonly found in weak passwords. Remove all occurrences of abc' from keyWord. Then, assign lengthStr wit the length of keyword. Ex.
"abc" is a string commonly found in weak passwords. Remove all occurrences of "abc' from keyWord. Then, assign lengthStr wit the length of keyword. Ex. If the input is abc57*ML>rnk Lepabc, then the output is: Remaining string: 57ML> snklep Length: 12 Note: - string. find(item) returns the index of the first occurrence of item in string. If no occurrence is found, then the function returns string n pos. - string replace(indx, num, subStr) replaces characters at indices ind x to indx+num-1 with a copy of substr. int mainO \{ string keyword; int strindex; int lengthStr; cin > keyword; strIndex =0; lengthstr =; cout "Remaining string: " keyword end: cout "Length: " lengthstr end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
