I have a string array in C# 3.5:
string [] times = new[] {“08:00 am” , “10:00 am”, “120”} ;
I would like to create indexes to times: StartTime, EndTime , ElapsedTime so that when I code:
StartTime= “09:00 am” ;
EndTime= “11:00 am” ;
then times[0] is set to “09:00 am” , etc.
I could create 3 methods:
private void StartTime(string time)
{ times[0] = time; }
private void EndTime(string time)
{ times[1] = time; }
private void ElapsedTime(string time)
{ times[2] = time; }
and code
StartTime("09:00");
but is there a simpler way to do it?