Updated: October 2009
There are two versions of Replace.The first version replaces one or more copies of a substring by using another substring. Both substrings are null-terminated. The second version replaces one or more copies of a character by using another character. Both versions operate on the character data stored in CStringT.
Replace can change the string length because pszNew and pszOld do not have to be the same length, and several copies of the old substring can be changed to the new one. The function performs a case-sensitive match.
Examples of CStringT instances are CString, CStringA, and CStringW.
For CStringA, Replace works with ANSI or multibyte (MBCS) characters. For CStringW, Replace always works with wide characters.
For CString, the character data type is selected at compile time based on and depends on whether the following constants are defined:
Character Data Type