Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char SpaceToEndl(char c)
- {
- if(c == ' ')
- return '\n';
- return c;
- }
- std::string SpacesToNewLines(const std::string& text)
- {
- std::string res;
- std::transform(text.begin(), text.end(), back_inserter(res), &SpaceToEndl);
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement