How would I split a string based on another substring in a simple way?
e.g. split on \"\\r\\n\"
message1\\r\\nmessage2
=>
Although boost::split indeed takes a predicate that operates on characters, there's a boost string algorithm that can split on substrings:
#include
#include
#include
#include
#include
#include
#include
int main()
{
std::string input = "message1foomessage2foomessage3";
std::vector v;
iter_split(v, input, boost::algorithm::first_finder("foo"));
copy(v.begin(), v.end(), std::ostream_iterator(std::cout, " "));
std::cout << '\n';
}