String join em Array de Objetos

14 de setembro de 2017   |   by administrador
Equipment[] ChildEquipments = new Equipment[10];

for (int i = 0; i < 10; i++) { ChildEquipments[i] = new Equipment(); ChildEquipments[i].nameEquipment = "Catraca "+ i; } string texto = string.Join(",", ChildEquipments.Select(w => w.nameEquipment));

Console.WriteLine(texto);
Console.ReadLine();
Tags: ,