Help with error

code: https://ide.codingblocks.com/s/461382

problem: replace with 3.14

getting some error

hello @raghav007

string current = s[i] + s[i+1];

u cant add 2 char like this to get string.


can I use substr like this?

yes,but u need to make sure that u have atleast 2 char remaining

string check = s.substr(i); 
	if(check.size() < 2){ 
		return s;
	}

why is it not working

check now->

no need yto handel this substr automatically take care of this case

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.