fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. string str = " texto com espaços em branco ";
  9. str.erase(remove(str.begin(), str.end(), ' '), str.end());
  10. cout << str;
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/90623/101
Success #stdin #stdout 0s 4356KB
stdin
Standard input is empty
stdout
textocomespaçosembranco