Hello people,
can anyone explain me why output from this program
Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str = "This is, you shouldn't see this, just a test!";
string :: size_type start, end;
string delim = ",";
start = str.find(delim);
if (start == string::npos)
{
return 0;
}
end = str.find(delim, start+delim.length());
str.erase(start, end+delim.length());
cout << str;
return 0;
}
is: "This is test!"(without quotes)?
I expected that characters between ',' (including them) would be removed.