http://blog.youkuaiyun.com/NetLinux
std::string strPath("C://Windows//System32//drivers");
std::string strZune = "drivers";
int pos = 0;
boost::iterator_range<std::string::iterator> retFind= boost::ifind_first(strPath, strZune);
pos = retFind.begin() - strPath.begin();
strPath.erase(retFind.end(), strPath.end());
本文介绍了一种利用Boost库中的ifind_first方法查找并删除指定子串的方法。通过具体的C++代码示例展示了如何从路径字符串中找到并移除特定部分。
549

被折叠的 条评论
为什么被折叠?



