Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

remove space in string c++

string removeSpaces(string str)
{
    stringstream s(str);
    string temp;
    str = "";
    while (getline(s, temp, ' ')) {
        str = str + temp;
    }
    return str;
}
//Input: Ha Noi Viet Nam
//Output: HaNoiVietNam
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #remove #space #string
ADD COMMENT
Topic
Name
6+8 =