//分割字符串
void Stringsplit(string str, const const char split, vector& res)
{
istringstream iss(str); // 输入流
string token; // 接收缓冲区
while (getline(iss, token, split)) // 以split为分隔符
{
res.push_back(token);
}
}
// 合并字符串
string mergeString(vector sStringTmp)
{
string newScpe;
for (int i = 0; i < sStingTmp.size(); i++)
{
string s1 = sStringTmp[i];
newScpe = newScpe + s1;
if (i != sStringTmp.size() - 1)
{
newScpe = newScpe + "\";
}
}
return newScpe;
}
void main()
{
string sTmp ="E:\das\1";
vector vecTmp;
Stringsplit(sTmp,'\',vecTmp);
string slastString = mergeString(vecTmp);
}