Collection to string using linq

Viewed 22341

I have a class

public class Person
{
    public string FirstName { get; set; }
    public string LastName { get; set; }   
}

List<Person> PersonList = new List<Perso>();
PersonList.Add(new Person() { FirstName = "aa", LastName = "AA" } );
PersonList.Add(new Person() { FirstName = "bb", LastName = "BB" } );

I'd like get a string with a comma separator for the LastName, using Linq, the result look like: AA,BB

Thanks,

3 Answers
Related