c# - How can I check if the same Date is already in a List? -
i have list of datetimes (with times , dates) , need mothod unique days out of seperate list
example:
[1.1.2015 12:34] [1.1.2015 12:34] [1.1.2015 12:34] [1.2.2015 4:34] [1.2.2015 2:34] [1.2.2015 1:34] [1.3.2015 8:34] [1.3.2015 1:34] [1.6.2015 2:34]
needs turned into:
[1.1.2015 0:0] [1.2.2015 0:0] [1.3.2015 0:0] [1.6.2015 0:0]
how do this?
you can group them on date
property , project keys:
var dates = dateandtimes.groupby(x=> x.date) .select(x=>x.key).tolist();
Comments
Post a Comment