I know this is a quite easy problem but I just want to solve it for myself once and for all
I would simply like to split a string into an array using a character as
Using vectors, strings and stringstream. A tad cumbersome but it does the trick.
std::stringstream test("this_is_a_test_string");
std::string segment;
std::vector seglist;
while(std::getline(test, segment, '_'))
{
seglist.push_back(segment);
}
Which results in a vector with the same contents as
std::vector seglist{ "this", "is", "a", "test", "string" };