标准C++为何不提供split函数?
标准C++为何不提供split函数? 最近发现一个问题,标准C++似乎没有直接提供split函数。后来发现,实际上,C++11解决这个问题并不难,也不需要多少代码。const std::string text = "12/01/10";const std::regex ws_re("-|/"); // -或者/分割std::vector<std::string> v;std::copy( std::sregex_token_iterator(text.begin(), text.
原创
2020-11-15 21:10:19 ·
403 阅读 ·
0 评论