Ok, great, I have upped the points to double because there is a second part to this question....now I need to parse the lunchtime variable as well...but this is more tricky....
see below of all potential values that I will need spilt off...below are all the possible scenarios that I would need to parse
lunchvalues = 15 min
lunchvalues = 30 min
lunchvalues = 45 min
lunchvalues = 1 hours
lunchvalues = 2 hours
one last one, which is the obvious of null
the above all the potential values and i need it spilt up for two variables
time = 45
amount = min
another example
time = 2
amount = hours
please advise...thanks.
lobos
ASKER
ok thanks for clarifying this...but now what do I do because I already had increased the points to this question on the premise of this second part question?
using System.Text.RegularExpress
class Demo {
static void Main(string[] args) {
string startTime = "2:15 PM";
DateTime dt = DateTime.Parse(startTime);
int hour = dt.Hour < 12 ? dt.Hour : dt.Hour - 12;
Console.WriteLine(hour.ToS
Console.WriteLine(dt.Minut
Console.WriteLine(dt.Hour < 12 ? "AM" : "PM");
}
}