Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. inline std::string SpacesToNewLines(const std::string& text)
  2. {
  3.     std::string format = text;
  4.     unsigned int pos = format.find(" ");
  5.    
  6.     while(pos <= format.size())
  7.     {
  8.         format.replace(pos, 1, "\n");
  9.         pos = format.find(" ", pos);
  10.     }
  11.    
  12.     return format;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement