I get a file as input and I read the first line like this (quotes mark the begin and end, but are not in the file):
" 1, 2.0, 3.0, 4.0 "
When I use the remove command like this:
astring = line;
cout << endl << "Before trim: " << line << endl;
remove(astring.begin(), astring.end(), ' ');
cout << endl << "After trim: " << astring << endl;
I got the output as:
1,2.0,3.0,4.02.0, 3.0, 4.0
I need the output as 1,2.0,3.0,4.0 only. What is the problem here?