I have a for each loop in vb.net for this particular example there are 2 items in list but after the first item the loop exits are there errors in the code
Public Function findUserID(ByVal list As List(Of KeyValuePair(Of String, String)), ByVal value As String)
Dim id As String = String.Empty
For Each kvp In list
If (kvp.Value = value) Then
id = kvp.Key
End If
Next
Return id
End Function
Try to use this:
One user told me to modify it in this way:
Sorry if this code has some error, but I cannot try and I usually write in C#.
So my code (in C#) would be: