Mid From PDF LINQ 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
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details