Answers for "c++ get string between two characters"

C++
0

c++ get string between two characters

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;
Posted by: Guest on May-09-2021

Code answers related to "c++ get string between two characters"

Browse Popular Code Answers by Language