CString::Replace

int ᷹ (TCHAR chOld, TCHAR chNew );

int ᷹ (LPCTSTR lpszOld, LPCTSTR lpszNew );

觡Ѻ

ŢԹᵹ١᷹ͧѡ ٹʵԧ¹ŧ?

chOld

ѡж١᷹chNew?

chNew

ѡе᷹chOld?

lpszOld

ǪѧѡлСͺѡж١᷹lpszNew?

lpszNew

ǪѧѡлСͺѡе᷹lpszOld?

˵

¡ѧѹҪԡ᷹ѡ ա Ẻáͧѧѹҧ᷹ԹᵹͧchOldѺchNewẺ᷹ѡ Ẻҧͧͧѧѹ᷹ԹᵹͧʵԧlpszOldѺԹᵹͧ.nbsp lpszNewʵԧͤ(&N);

ѡҨ ŴҴ繼Ţ᷹ͧ ǤlpszNewlpszOld繵ͧҡѺ ˭-硵çѺԹ÷ͧ?

ҧ

//First ҧ Ѻ ҡѺ

CString strZap("C--")
int n = strZap.Replace ('- ', '+');
ASSERT(n == 2)
ASSERT (strZap == "c ++");

ҧ //Second  դǵҧѹ

CString strBang ("ءͺ͡");
n = strBang.Replace ("͡" "");
ASSERT(n == 1)
n = strBang.Replace ("ͺ" "");
ASSERT(n == 1)
n = strBang.Replace ("ͫ" NULL);
ASSERT(n == 1)
ASSERT (strBang == "ء playsnbsp ");

/ / ˵ سйաêͧҧ㹢ͧس
/ / sentence ź鹷  / / ѡС᷹ i.e.,"ice "(&N)

Ҿ CString |nbsp Ҫԡͧ| ἹԢͧӴѺ(&N)

nbspCString::Remove(&N)

Index