使用boost查找区分大小写查找,查找一个字符串在另外一个字符串的位置,返回索引。

    技术2022-05-20  63

    http://blog.csdn.net/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());


    最新回复(0)