I have const wchar_t*
looks like "\n\t\t\t\tsomething\n\t\t\t\t"
and I want to get "something"
. What is the most efficient way to do it?
[EDIT] I've worked out something like this:
typedef wchar_t XMLCh
const XMLCh* trimTabs(const XMLCh* text)
{
string dest = XMLString::transcode(text);
dest.erase(remove(dest.begin(),dest.end(),'\t'), dest.end());
dest.erase(remove(dest.begin(),dest.end(),'\n'), dest.end());
return XMLStr(dest.c_str()).getXMLStr();
}
XMLStr
class which is existing already in my project helped mi a lot. I hope it's good answer. XMLString is a class from Xercesc library.