Answer the question
In order to leave comments, you need to log in
How to remove characters in a string that are in pairs?
Hello everyone, I need a hello)
Task: there is a string "abvgd" - from it you need to remove the lines that stand in a double place. Tobish should get "abvgd" -> "avd".
Answer the question
In order to leave comments, you need to log in
string abcde = "abcde";
for (int i = 1; i < abcde.length(); i++) {
abcde.erase(i, 1);
}
cout << abcde << endl;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question