added: to misc:

void OnlyDigit(StringType & s, bool allow_comma = true)
       removes all non-digit characters from a string


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@818 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-03-11 16:21:52 +00:00
parent b7007da5a9
commit 0b528c7225
2 changed files with 52 additions and 16 deletions

View File

@@ -622,11 +622,11 @@ std::wstring::size_type i;
}
bool IsEmailCorrectChar(wchar_t c)
{
bool correct = false;
bool IsEmailCorrectChar(wchar_t c)
{
bool correct = false;
const wchar_t * allowed_chars = L"@.!#$%&'*+-/=?^_`{|}~";
if( (c >= 'A' && c<='Z') ||
@@ -646,12 +646,12 @@ bool correct = false;
}
}
}
return correct;
}
return correct;
}
bool ValidateEmail(const wchar_t * email)
{
int at = 0; // how many '@'
@@ -674,13 +674,13 @@ bool ValidateEmail(const wchar_t * email)
return true;
}
bool ValidateEmail(const std::wstring & email)
{
return ValidateEmail(email.c_str());
}
return ValidateEmail(email.c_str());
}