using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
IEnumerable<Comment> comments = new List<Comment>()
new Comment()
Id = 1,
Text = "Comments Text 1"
},
Id = 2,
Text = "Comments Text 2"
}
};
var filteredComments = comments.Where(x => x.Id == 41).Select(x => x.Text).ToArray();
Console.WriteLine(filteredComments.Length);
var delimittedStrings = string.Join(Environment.NewLine, filteredComments);
Console.WriteLine(delimittedStrings.Length);
Console.WriteLine(delimittedStrings);
public class Comment
public int Id { get; set; }
public string Text { get; set; }