c#提取

 string email = Console.ReadLine();
            int atIndex = email.IndexOf('@');

            string userName = email.Substring(0, atIndex);

            string domainName = email.Substring(atIndex + 1);

            Console.WriteLine(userName);

            Console.WriteLine(domainName);
            Console.ReadKey();

 

posted @ 2015-09-22 10:59  尘梦  阅读(165)  评论(0编辑  收藏  举报