Skip to content

Instantly share code, notes, and snippets.

@DapperFox
Created July 19, 2013 03:17
Show Gist options
  • Select an option

  • Save DapperFox/6034855 to your computer and use it in GitHub Desktop.

Select an option

Save DapperFox/6034855 to your computer and use it in GitHub Desktop.
Console.WriteLine("Enter the first day of the week (day, month, year) eg(24, 02, 2013)");
string userInput = Console.ReadLine();
if (dateArray[0] < 1 && dateArray[0] > 31 || dateArray[1] < 1 && dateArray[1] > 12 || dateArray[2] < 1000 && dateArray[2] > 2013)
{
Console.WriteLine("Incorrect form for a date. Please try again.");
InputHours();
}
string[] splitDate = userInput.Split(',');
for (int i = 0; i < splitDate.Length; i++)
{
dateArray[i] = Convert.ToInt32(splitDate[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment