I have a list of objects. Each object contains a "DisplayName" property.
I want to create another list of string objects, where each line represents the first letter or character (may be a number) in the DisplayName property for all objects in the original list, and I want the list to be great.
So, for example, if there were the following three objects in my list:
(1) DisplayName = 'Anthony' (2) DisplayName = 'Dennis' (3) DisplayName = 'John'
I would like to create another list containing the following three lines:
(1) 'A' (2) 'D' (3) 'J'
Any idea how to do this with minimal coding using lambda expressions or linq?
Chris source share