According to: C++ How to get substring after a character?
x.substr(x.find(":") + 1);
How can I do the same, but with whitespace ? because find()
ignores spaces.
According to: C++ How to get substring after a character?
x.substr(x.find(":") + 1);
How can I do the same, but with whitespace ? because find()
ignores spaces.
If you want white space you need to use find_if()
with an appropriate lambda that calls is::space()
auto pos = find_if(std::begin(x), std::end(x), [](unsigned char c){return std::isspace(c);});
pos++;
for(;pos!=x.end();pos++)
cout << *pos;