Military Time Problem Exceptions C#
Im getting an exception in every case. It says "Input String was not in the correct format" Im using the default code that is automatically written in SL playground. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { string twlvhstime; string converted; int thehour; twlvhstime = Console.ReadLine(); if (twlvhstime[6] == 'A') { thehour = Int32.Parse(twlvhstime); Console.WriteLine(thehour); } converted = twlvhstime.Substring(0,5); } } }