removing double quotes from a CString

Does anyone know how to add a double quotation mark to a CString literal. I have tried \" and it seems not to work for some reason.
Who is Participating?
GGRUNDYConnect With a Mentor Commented:
I'm guessing this will do the trick

" ,.;:[]{}()*&%#@!~`'?\n\"\x93\x94"

Cheers Greg
GareonAuthor Commented:
I am using a CString containing special characters which I want to remove from CStrings in order to separate out only the words. The CString looks like this:
" ,.;:[]{}()*&%#@!~`'?\n\""

When I check against each char in the CString, the program removes everything but the double quotes, which it insists on tacking onto words.

CString str = "\"" ;

// str will contain a single character (the double quote)

I would suggest you find double quotes using the Find member function of CString

int nIndex = str.Find( '"' ) ; // single quote, double quote, single quote

My guess is you are confusing the single and double quoting mechanism.  Single quotes are used for char variables, double quotes for strings.

Your question is not clear, perhaps you want to explain more or post some code

Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Just a guess.... When searching the CString for the double quote search for \" and not for "

If it works good, if not :-| (Maybe give some code where you try to find the string or somethin)

This is strange
CString str ( _T("text"));

str = CString(_T("\"")) + CString(_T("quoted "))+ str + CString(_T("\""));

should result in "quoted text", and str.Find( "\"") or str.Find( '\"') should both work... (and even the constructors shouldn't be necessary...)
Gareon, it seems the common theme here is "it should work". Would you please post the source code so we can make it work.
All Courses

From novice to tech pro — start learning today.