Deleting everything between two quotes in a string Is this the easiest way to delete everything between and including the two first quotes (if present) in an std::wstring?

unsigned int firstQuotePos = logFileName.find_first_of(L"\"");
unsigned int secondQuotePos = logFileName.find_first_of(L"\"", firstQuotePos + 1);

if (firstQuotePos != std::wstring::npos &amp;&amp; secondQuotePos != std::wstring::npos)
{
    logFileName = std::wstring(logFileName.begin(), logFileName.begin() + firstQuotePos)
        + std::wstring(logFileName.begin() + secondQuotePos + 1, logFileName.end());
}
C++ is very picky about types.
You should always try and use the correct ones:

unsigned int firstQuotePos = logFileName.find_first_of(L"\"");
unsigned int secondQuotePos = logFileName.find_first_of(L"\"", firstQuotePos + 1);


should be:

std::string::size_type firstQuotePos  = logFileName.find_first_of(L"\"");
std::string::size_type secondQuotePos = logFileName.find_first_of(L"\"", firstQuotePos + 1);


Next there is already an erase that does this:

if (firstQuotePos != std::string::npos)
{
    logFileName.erase(firstQuotePos, (secondQuotePos - firstQuotePos));
}