源字符串:{ABE1ACFA-1F60-4A65-954A-61E107CE9740}
要删除的字符:"{-}"
void strim(const std::string& p_szStrim, std::string& p_strSrc)
{for (int nIndex = 0; nIndex < p_szStrim.length(); ++nIndex)
{
int nPos = -1;
while ((nPos = p_strSrc.find(p_szStrim[nIndex])) != -1)
{
p_strSrc.erase(nPos, 1);
}
}
}
运行后的结果:ABE1ACFA1F604A65954A61E107CE9740