The CString type I am talking about is microsoft's.
I've attempted two methods;
Method 1) using the Remove() and Replace() function found on msdn website, and Visual c++ says Error:argument of type "const char*" is incompatible with argument of type "wchar_t"
Specifically my code is:
#include <cstring>
CString sTmp= sBody.Mid(nOffset);
CString sFooter= L"https://" + sTmp.Mid(0, nEnd );
sFooter.Remove("amp;");
And I don't want to remove a single character at a time because it will get rid of other 'a's.
For some reason, when I convert sFooter to a std::string, random "amp;"s appear in the string that shouldn't be there...
I am converting sFooter to a std::string like this:
CT2CA p (sFooter);
string str (p);
Method 2) Converting the CString to std::string, then using erase() and remove() to get rid of the "amp;"s
#include <string>
#include <algorithm>
sFooter2.erase(std::remove(sFooter2.begin(), sFooter2.end(), "amp;"), sFooter2.end());
But Visual studio's output shows this: http://pastebin.com/s6tXQ48N