Answer the question
In order to leave comments, you need to log in
Why doesn't LINQ work properly?
I just started learning LINQ and sometimes there are difficulties,
why does it output only "sa" and not a string from the first characters of the array of strings?
//4. Дана последовательность непустых строк.Используя метод Aggregate,
// получить строку, состоящую из на-
//чальных символов всех строк исходной последовательности.
string[] s = new[] { "sgsg", "tdfgsdfg", "rdfgsdfg", "iiutyiu", "4fghdhsfd", "kasdgfdsf", "asdfdfsd" };
var res = s.Aggregate((a,b) => a.First() + "" + b.First() );
Console.WriteLine($"{res}");
Console.ReadLine();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question