Posted on 2007-08-29 16:46
daiybh 閱讀(752)
評(píng)論(0) 編輯 收藏 引用
今天瞎逛發(fā)現(xiàn)一個(gè)好玩的api,,,用AfxExtractSubString()解析復(fù)合串
特此標(biāo)記一下。
-----------------------
CString str = "123,456,789";
CString output = "";
for (int i=0; i<3; i++)
{
AfxExtractSubString(output, str, i, ',');
AfxMessageBox(output);
}
參數(shù)1:用來存放你取出的子串
參數(shù)2:要拆分的整個(gè)字符串
參數(shù)3:你要取的子字符串位置,從0開始
參數(shù)4:特定字符