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>
继续啊楼主
页:
[1]