I have a enumerable like this (when I am debugging program says it is IEnumerable<String[]>
. I do not know IEnumerable
sufficiently):
var result = from p in displayedParticipants
select new[]
{
p.Country,
p.City,
p.SurveyStartDate.ToString("dd.MM.yyyy HH:mm"),
p.SurveyFinishDate.ToString("dd.MM.yyyy HH:mm"),
p.Device.ToString(),
p.IP.ToString(),
p.Longitude.ToString(),
p.Latitude.ToString(),
};
And I have an index array which indicates that which field is selected from this result, i.e the result object is the list of String array and each String array contains these fields.
string[] toShow = {0,1}.
That means I want only to get 1st and 3rd fields (which are country and city) and remove all other fields. But IEnumerable<String[]>
does not let me any remove operation.
How can I solve this problem? Thanks for any help.