15,978
社区成员
发帖
与我相关
我的任务
分享
bool IsDate( LPCTSTR pszText )
{
ASSERT_VALID_STRING( pszText );
// format should be 99/99/9999.
if( lstrlen( pszText ) != 10 )
return false;
return _istdigit( pszText[ 0 ] )
&& _istdigit( pszText[ 1 ] )
&& _istdigit( pszText[ 2 ] )
&& _istdigit( pszText[ 3 ] )
&& pszText[ 4 ] == _T('/')
&& _istdigit( pszText[ 5 ] )
&& _istdigit( pszText[ 6 ] )
&& pszText[ 7 ] == _T('/')
&& _istdigit( pszText[ 8 ] )
&& _istdigit( pszText[ 9 ] );
}