void str_split(const std::string & src, const std::string & sep, std::vector<std::string> & vec_str)
{
    std::string::size_type start = 0;
    for(std::string::size_type end = src.find(sep, start); end != std::string::npos; end = src.find(sep, start))
    {
        if(end > start)
        {
            vec_str.push_back(src.substr(start, end - start));
        }
        start = end + sep.length();
    }
    if(start < src.length())
    {
        vec_str.push_back(src.substr(start, src.length() - start));
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-01-02
  • 2021-05-21
  • 2021-07-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2021-12-01
相关资源
相似解决方案