N
none
I am trying to use this function:
std::string RemoveMultipleWhiteSpaces( std::string s ){
std::string search = " "; // this is 2 spaces
size_t index;
while( (index = s.find(search)) != std::string::npos ) {
s.erase(index,1);
}
return s;
}
to convert duplicate blanks or tabs in a string to single blanks, eg.:
a b cc d
shold be:
a b cc d
But if my input string contains a tab it does not work. How do I modify the above to work correctly
with tabs in a string?
std::string RemoveMultipleWhiteSpaces( std::string s ){
std::string search = " "; // this is 2 spaces
size_t index;
while( (index = s.find(search)) != std::string::npos ) {
s.erase(index,1);
}
return s;
}
to convert duplicate blanks or tabs in a string to single blanks, eg.:
a b cc d
shold be:
a b cc d
But if my input string contains a tab it does not work. How do I modify the above to work correctly
with tabs in a string?