Dear Masters
I really appreciate Can you please explain this code of linq what is means here of tolookup
I am getting confuse please check code and I also pasted result
Private Shared Sub Sample_ToLookup_Lambda()
Dim words As String() = {“one”, “two”, “three”, “four”, “five”, “six”, _
“seven”}
Dim result = words.ToLookup(Function(w) w.Length)
For i As Integer = 1 To 5
Debug.WriteLine([String].Format("Elements with a length of {0}:", i))
For Each word As String In result(i)
Debug.WriteLine(word)
Next
Next
End SubOutput:
Elements with a length of 1:
Elements with a length of 2:
Elements with a length of 3:
one
two
six
Elements with a length of 4:
four
five
Elements with a length of 5:
three
seven