Answers for "how to extract unique years from a list of different years in c#"

C#
0

how to extract unique years from a list of different years in c#

List<DateTime> result = source
  .Select(d => new DateTime(d.Year, d.Month, 1))
  .Distinct()
  .ToList();
Posted by: Guest on August-30-2021

C# Answers by Framework

Browse Popular Code Answers by Language