Как удалить определенные символы из строки в C ++?

For example I have a user input a phone number.

cout << "Enter phone number: ";
INPUT: (555) 555-5555
cin >> phone;

I want to remove the "(", ")", and "-" characters from the string. I've looked at the string remove, find and replace functions however I only see that they operate based on position.

Is there a string function that I can use to pass a character, "(" for example, and have it remove all instances within a string?

93
задан Ciro Santilli 新疆改造中心法轮功六四事件 3 April 2017 в 17:22
поделиться