I'm writing a program that limits how many characters can be in the output. Essentially a student id assigner and I'm now sure how to count only a specific amount of characters in a string. My code looks like this so far.
string firstname, middleinitial, lastname,yearofentry;
int year;
Console.WriteLine("Please enter your first name.");
firstname = Console.ReadLine();
Console.WriteLine("Please enter your middle initial.");
middleinitial = Console.ReadLine();
Console.WriteLine("Please enter your last name.");
lastname = Console.ReadLine();
Console.WriteLine("Please enter your year of entry.");
yearofentry = Console.ReadLine();
year = (Convert.ToInt32(yearofentry)-2000);
Console.WriteLine(firstname +middleinitial+ lastname + year + "@mail.edu");
}
}
}