Getting rid of newline in CString in C++
===

I have a html/xml document that is originally a CString and I want to get rid of all the newlines, essentially put everything into one line. I've tried converting it to std::String and using:

    #include <algorithm>
    #include <string>

    str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());

But it didn't work.