B
barcaroller
I have a text file with mixed carriage returns ('\n' and '\r\n').
On Linux, both the std::string getline() global function and the
std::iostream getline() member function are keeping some of the newlines in
the result (I suspect they look only for the '\n').
* Is there a quick way I can tell either function to gobble up both
Windows-style and Unix-style newlines?
* If not, what would be an efficient way of getting rid of them? Currently
I use string::find_last_of("\n\r") + string::erase() but this is not very
efficient.
On Linux, both the std::string getline() global function and the
std::iostream getline() member function are keeping some of the newlines in
the result (I suspect they look only for the '\n').
* Is there a quick way I can tell either function to gobble up both
Windows-style and Unix-style newlines?
* If not, what would be an efficient way of getting rid of them? Currently
I use string::find_last_of("\n\r") + string::erase() but this is not very
efficient.