Splitting a string by a character

前端 未结 8 975
夕颜
夕颜 2020-11-27 05:18

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

8条回答
  •  再見小時候
    2020-11-27 06:03

    Boost has the split() you are seeking in algorithm/string.hpp:

    std::string sample = "07/3/2011";
    std::vector strs;
    boost::split(strs, sample, boost::is_any_of("/"));
    

提交回复
热议问题