class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
List<Person> theList = populate it with a list of Person objects
How can I get a string which contains all the FirstName of the objects in the list separated by a comma. Eg: John,Peter,Jack
A basic solution would be to iterate through each object but I'm sure there is a one-line solution.
Thanks.