Answers for "replace whitespace with space c++ char*"

C++
6

c++ remove whitespace from string

#include <algorithm>

int main()
{
    std::string str = "H e l l o";
    str.erase(remove(str.begin(), str.end(), ' '), str.end());
    std::cout << str; // Output Hello
    
    return 0;
}
Posted by: Guest on November-10-2020
2

replace komma with space C++

replace(str.begin(), str.end(), ',', ' ');

# include <algorithm> but works without
Posted by: Guest on September-25-2020

Code answers related to "replace whitespace with space c++ char*"

Browse Popular Code Answers by Language