2007年10月21日星期日

괄호 삭제

CString CAutoSyncDlg::_Remove_Parenthesis(CString strData){
CString strDummy = _T("");
int nTStart, nTEnd; bool bExit = false;
while(!bExit) { //__() 소괄호 제거 nTStart = strData.Find(_T("("), 0); nTEnd = strData.Find(_T(")"), 0);
if(nTStart == -1 nTEnd == -1) { bExit = true; } else { if(nTEnd < nTStart) { bExit = true; } else { strDummy = strData.Mid(nTStart, (nTEnd+1)-nTStart); strData.Replace(strDummy, _T("")); } } }
bExit = false; while(!bExit) {//__[] 대괄호 제거 nTStart = strData.Find(_T("["), 0); nTEnd = strData.Find(_T("]"), 0);
if(nTStart == -1 nTEnd == -1) { bExit = true; } else { if(nTEnd < nTStart) { bExit = true; } else { strDummy = strData.Mid(nTStart, (nTEnd+1)-nTStart); strData.Replace(strDummy, _T("")); } } }
bExit = false; while(!bExit) {//__{} 중괄호 제거 nTStart = strData.Find(_T("{"), 0); nTEnd = strData.Find(_T("}"), 0);
if(nTStart == -1 nTEnd == -1) { bExit = true; } else { if(nTEnd < nTStart) { bExit = true; } else { strDummy = strData.Mid(nTStart, (nTEnd+1)-nTStart); strData.Replace(strDummy, _T("")); } } }

return strData;}

没有评论: