标签:
static void Main(string[] args)
{
while (true)
{
string email = Console.ReadLine();
if (email.Contains("@") && (email.Contains(".com") || email.Contains(".cn")))
{
int index = email.IndexOf("@");
Console.WriteLine("您输入的邮箱正确!");
Console.WriteLine("您的邮箱用户名为:"+email.Substring(0,index));
}
else
{
Console.WriteLine("您输入的邮箱不正确!");
}
}
}
标签:
原文地址:http://www.cnblogs.com/dlexia/p/4389072.html