How can I eliminate this special character ' in my
cstring?
thanks.
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Regards,
Elias
CStrings str;
str = _T("ABCDE'FGH");
str.Replace(_T("'"), _T("")); // " ' " replaced by empty string
TRACE(str);
or, if you are using the string in SQL as suggested, then you can 'stuff'
the single quote with 2 - which is then accepted:
CStrings str;
str = _T("ABCDE'FGH");
str.Replace(_T("'"), _T("''")); // " ' " replaced by " ' ' " - no spaces
inside quotes.
TRACE(str);
- Tim
"samuel" <samb...@hotmail.com> wrote in message
news:041101c3114c$8d5ee8e0$a301...@phx.gbl...
Joseph M. Newcomer [MVP]
"samuel" <samb...@hotmail.com> ??????:041101c3114c$8d5ee8e0$a301...@phx.gbl...
> Press any key to continue . . .
*/