C # determine whether the email address is valid,
Question requirements:
Class Program {static void Main (string [] args) {Console. writeLine ("enter the correct email address, ending with @ sina.com"); string us = Convert. toString (Console. readLine (); string str1 = us. replace ("@", ""); int count = us. length-str1.Length; string str2 = us. replace (". "," "); int count2 = us. length-str2.Length; int count3 = us. length-1; int xl = us. indexOf (". ")-us. indexOf ("@"); bool mw = (us. indexOf ("@ sina.com") = (us. Length-9); while (count = 1 & count2 = 1 & us. indexOf ("@")> 0 & us. indexOf (". ")> us. indexOf ("@") & us. indexOf (". ") <count3) {if (xl! = 1 & us. contains ("@ sina.com") & mw) {Console. writeLine ("correct");} else {Console. writeLine ("Incorrect email address entered");} break;} Console. readLine ();}}
2016 - 07 - 20