Created
November 12, 2019 16:49
-
-
Save elowy01/c882962039ee28193c88327e7146dc91 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <boost/algorithm/string.hpp> | |
using namespace std; | |
int main() | |
{ | |
//split tab-separated string into vector of strs | |
string line("test\ttest2\ttest3"); | |
vector<string> strs; | |
boost::split(strs,line,boost::is_any_of("\t")); | |
//Now, concatenate this vector of strings into string | |
std::string joinedString = boost::algorithm::join(strs, "\t"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment