Advertisement
Vultraz

Untitled

Oct 16th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1.     std::vector<std::string> res;
  2.  
  3.     std::stringstream ss;
  4.     ss.str(val);
  5.  
  6.     std::string item;
  7.     while(std::getline(ss, item, c)) {
  8.         if(flags & STRIP_SPACES) {
  9.             boost::trim(item);
  10.         }
  11.  
  12.         if(!(flags & REMOVE_EMPTY) || !item.empty()) {
  13.             res.push_back(std::move(item));
  14.         }
  15.     }
  16.    
  17.     return res;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement