MFC
[MFC] 특정 문자로 끝나는지 확인하는 방법
iwoohaha
2009. 7. 16. 11:14
반응형
BOOL IsEndWithChar(CString strCheckString, char endChar)
{
return (strCheckString.ReverseFind(endChar) == strCheckString.GetLength() - 1);
{
return (strCheckString.ReverseFind(endChar) == strCheckString.GetLength() - 1);
}
CString str = "C:\\Temp\\";
BOOL bEndOK = IsEndWithChar(str, '\\'); // TRUE
CString str = "C:\\Temp";
BOOK bEndNot = IsEndWithChar(str, '\\'); // FALSE
CString str = "C:\\Temp\\";
BOOL bEndOK = IsEndWithChar(str, '\\'); // TRUE
CString str = "C:\\Temp";
BOOK bEndNot = IsEndWithChar(str, '\\'); // FALSE
반응형