Last active
June 30, 2024 14:24
-
-
Save trikitrok/bd1db56add1c595cd762 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 <boost/algorithm/string.hpp> | |
#include <boost/algorithm/string/join.hpp> | |
#include <boost/algorithm/string/regex.hpp> | |
#include <boost/regex.hpp> | |
std::vector<std::string> StringUtils::split( | |
const std::string & str, | |
const std::vector<std::string> & delimiters) { | |
std::vector<std::string> tokens; | |
boost::algorithm::split_regex( | |
tokens, | |
str, | |
boost::regex( | |
boost::join(escapeDelimiters(delimiters), "|")) | |
); | |
return tokens; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment