📄 validate.cpp
字号:
// Validate.cpp: implementation of the CValidate class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "sms.h"
#include "Validate.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CValidate::CValidate()
{
}
CValidate::~CValidate()
{
}
BOOL CValidate::IsDigitAndAlpha(CString & str)
{
int i=0;
for(;i<str.GetLength();i++)
{
if(isdigit(str[i]) || isalpha(str[i]))
{
continue;
}
else
{
return FALSE;
}
}
return TRUE;
}
BOOL CValidate::ValidatePhone(const CString &str)
{
int length = str.GetLength();
for (int i=0; i<length; ++i)
{
if (!(isdigit(str[i]) || (str[i] == '+' && i == 0)))
{
return FALSE;
}
}
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -