Find
ReverseFind
함수가 있다.
이름 그대로 Find는 앞에서 부터, ReverseFind는 뒤에서 부터 찾는다.
wchar_t 타입데이터를 함수 파라미터로 갖는다.
Find(wchar_t ch)
ReverseFind(wchar_t ch)
반환값은 찾은 문자의 시작 인덱스.
예를 들어 파일 확장자 명을 지우고 싶을 때
CString strFileName = _T("test.log");
int nPos = strFileName.ReverseFind('.');
strFileName.Delete(nPos, strFileName.GetLength() - 1);
//를 하면 .부터 그 뒤까지 지워진다.
cpp의 std::string, std::wstring 이랑은 사용법이 좀 다르다.