I have a collection of DateTime
named reportLogs
. I need to create a Collection<T>
of ShortDateString
from this Collection<DateTime>
. What is the most efficient way to do it?
Collection<DateTime> reportLogs = reportBL.GetReportLogs(1, null, null);
Collection<string> logDates = new Collection<string>();
foreach (DateTime log in reportLogs)
{
string sentDate = log.ToShortDateString();
logDates.Add(sentDate);
}
EDIT:
The question is about Collection of string
; not about List of string
. How can we handle the Collection of string ?
REFERENCE: