📜  c++ 在字符处拆分 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:53.363000             🧑  作者: Mango

代码示例1
std::stringstream test("this_is_a_test_string");
std::string segment;
std::vector seglist;

while(std::getline(test, segment, '_'))
{
   seglist.push_back(segment); //Spit string at '_' character
}