Whats the most efficient way of removing a \'newline\' from a std::string?
If its anywhere in the string than you can't do better than O(n).
And the only way is to search for '\n' in the string and erase it.
for(int i=0;i
For more newlines than:
int n=0; for(int i=0;i
It erases all the newlines once.