Answers for "remove space from text"

C++
6

how to remove spaces from a 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
0

Deleting all white spaces in a string

.replaceAll(/\s/g,'')
Posted by: Guest on November-21-2021

Code answers related to "remove space from text"

Browse Popular Code Answers by Language