有妖气 发表于 2016-12-10 16:45:48

C++ win32下的找出中间文本方法

stringFindMidStr(string while_str, string front_str, string behind_str)
{
        int index;
        int index2;
        index = while_str.find(front_str, 0);
        if (while_str.npos == index)
        {
                return "";
        }
        index = index + front_str.length();
        index2 = while_str.find(behind_str, index);
        if (while_str.npos == index2)
        {
                return "";
        }
        return while_str.substr(index, index2 - index);
}

用了string库 自己加头文件

#include<string>



qxuem 发表于 2017-1-16 12:30:56

继续啊楼主
页: [1]
查看完整版本: C++ win32下的找出中间文本方法