Mid LINQ

How to find employees whose names start and end with the same?

How to find employees whose names start and end with the same

letter?

var filtered = employees

.Where(e => e.Name.StartsWith(e.Name.Last().ToString(),

StringComparison.OrdinalIgnoreCase));

foreach (var emp in filtered)

Console.WriteLine(emp.Name);

More from LINQ Tutorial

All questions for this course