public static void Main()
string strItemCode = "sony-dvd-062019";
Console.WriteLine("Original Item Code: {0}", strItemCode);
string[] strArray = strItemCode.Split('-');
Console.WriteLine("Manufacturer: {0}",strArray[0]);
Console.WriteLine("Product: {0}",strArray[1]);
int dash1 = strItemCode.IndexOf("-");
int dash2 = strItemCode.IndexOf("-",dash1+1);
string month = strItemCode.Substring(dash2+1,2);
Console.WriteLine("Month Produced: {0}",month);
int length = month.Length;
string year = strItemCode.Substring(dash2+length+1,4);
Console.WriteLine("Year Produced: {0}",year);
Console.WriteLine("Please input your email address");
string email = Console.ReadLine();
while (email.IndexOf("@") < 0 || string.IsNullOrEmpty(email) || email.IndexOf(".") < 0 )
Console.WriteLine("This is not a valid email address");
Console.WriteLine("Please enter a valid address, this contains an @ and .");
email = Console.ReadLine();
int userL = email.IndexOf("@");
Console.WriteLine(userL);
string[] stremail = email.Split('@');
Console.WriteLine("Username is: {0}",stremail[0]);
Console.WriteLine("Domain is: {0}",stremail[1]);