📅  最后修改于: 2022-03-11 14:44:51.566000             🧑  作者: Mango
string str = "STARTDELIMITER_0_192.168.1.18_STOPDELIMITER";
unsigned first = str.find(STARTDELIMITER);
unsigned last = str.find_last_of(STOPDELIMITER);
string strNew = str.substr (first,last-first);
std::cout << strNew << std::endl;