In Java I can do this:
List<String> stringList = getRandomStrings(100_000, 1000);
IntSummaryStatistics stats =
stringList.stream()
.filter(Objects::nonNull)
.mapToInt(String::length)
.summaryStatistics();
System.out.println(stats);
The output is:
IntSummaryStatistics{count=100000, sum=49868013, min=0, average=498.680130, max=999}
Does linq have the same functionality? Or do I have to calculate everything seperately?
Java does this in one go, and it looks like in C# you have to calculate all the constituents Average(), Count(), Sum(), Min() and Max() separately.