When I run my code with the input "<b>this should be bold</b>asdf<head>inception of<head>this should be deleted</head>pooooop</head>asdf", it places an * between the l and the d, like so bol*d</b>. However, I'm not sure why. This code "std:: size_t end_bold = input.find ("</b>");" is finding the correct index of the string. But places the * in the wrong place. Any suggestions?
On line 40 you insert a character at the beginning of the string. On line 41, you use the index of a letter calculated before you inserted a character at the beginning of the string.