Split a list or ordered dates into weeks using linq [closed]
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . Say I have a list of 5 dates [Mar 2,Mar 6, Mar 7, Mar 26] all in the year 2018. The week start on Saturday and end Sunday. I want the following result [Mar 2] [Mar 6, Mar 7] [Mar 26] How can I do it with LINQ? Or in a functional way. 回答1: You can use the following on DateTime