How to find same substring

by using find() how can i find index of next bye in “bye bye”;

hello @karnawatsanyam
first find the position of first bye using simple find function
let say it returns position pos .now again use find function but pass pos+1 as second parameter this will give u next bye.

pls refer this -> https://www.geeksforgeeks.org/string-find-in-cpp/

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.