i have a list of objects and i want to create a list of attributes of those objects. The following works:
List<string> dates = objectlist.Select(d => d.date).ToList();
The date is stored as string in a strange format, so i just want to first 12 chars and tried this:
List<string> dates = objectlist.Select(d => d.date.Substring(0,12)).ToList();
this fails with a hint that there is no existing object instance... I do not know what is the problem here but i want to avoid going to the list a second time.
What is the best way to achieve what i want?