Hi,
Example:
string emailAddr = "MyEmail@live.com";
bool isValid = IsEMailAddrValid(emailAddr);
if (isValid)
{
}
private bool IsEMailAddrValid(string emailAddr)
{
bool result = true;
int count = emailAddr.Count(f => f == '@');
if (count == 0)
{
return false;
}
if (count > 1)
{
return false;
}
count = emailAddr.Count(f => f == '.');
if (count == 0)
{
return false;
}
if (count > 1)
{
return false;
}
string theChar = emailAddr.Split('@')[1].ToString();
int theCharLen = theChar.Split('.')[0].ToString().Length;
if (theCharLen < 2)
{
result = false;
}
return result;
}
Regards,