Join custom objects into a concatenated string in .NET C#
April 24, 2015 1 Comment
Say you have the following Customer object with an overridden ToString method:
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public string City { get; set; }
public override string ToString()
{
return string.Format("Id: {0}, name: {1}, city: {2}", Id, Name, City);
}
}