Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27186

Function(n) - LINQ

$
0
0
I'm not to familiar with LINQ, so I'm trying to familiarize myself. I'm starting by finding examples that were posted here on the forums. One example is this thread, where I posted a solution that's 19 lines long, and JMcIlhinney post a solution that's a one-liner! So going off of his example:
vb.net Code:
  1. Dim exclusive_numbers() As Integer = Enumerable.Range(0, 10).OrderBy(Function(n) r.Next(11)).ToArray

I understand setting up the Enumerable range, but I don't understand the .OrderBy(Function(n). What exactly does that do,the function(n)? I mean I get the OrderBy sets it in some kind of order, but I don't get the Function(n).

Viewing all articles
Browse latest Browse all 27186

Trending Articles