Horje
removing a character from a string in c++ Code Example
removing a character from a string in c++
#include<iostream>
#include<algorithm>

using namespace std;
main() {
   string my_str = "ABAABACCABA";

   cout << "Initial string: " << my_str << endl;

   my_str.erase(remove(my_str.begin(), my_str.end(), 'A'), my_str.end()); //remove A from string
   cout << "Final string: " << my_str;
}




8

Related
range of long long in c++ Code Example range of long long in c++ Code Example
string to char array c++ Code Example string to char array c++ Code Example
input a string in c++ Code Example input a string in c++ Code Example
conda list envs Code Example conda list envs Code Example
list conda environments Code Example list conda environments Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13