Question How do I fix? Error: Select' is not a member of 'System.Collections.Generic.List(Of S

SchoolWork

Member
Joined
Dec 16, 2012
Messages
5
Programming Experience
3-5
Keep getting error: 'Select' is not a member of 'System.Collections.Generic.List(Of String)'.
I am rendering x86 and using framework 2.0 (as its unnecessary for the direct player I'm using)


How do I fix this? or is there another method of doing this?
The purpose of this function is simply to sort an array.
Error.png


Code:
VB.NET:
[COLOR=#000000][FONT=Verdana]Position15 = Sortlinks(Position15)[/FONT][/COLOR]
[COLOR=#000000][FONT=Verdana]    End Sub
    Private Function Sortlinks(ByVal Info As List(Of String))
        Dim order() As Integer = Info.Select(Function(s) If(s.Contains("Facebook.com"), 0, If(s.Contains("Twitter.com"), 1, If(s.Contains("MySpace.com"), 2, If(s.Contains("Youtube.com"), 3, If(s.Contains("Linkedin.com"), 4, -1)))))).ToArray
        Dim temp() As String = Info.ToArray

        Array.Sort(order, temp)
        Info = temp.ToList
        Return Info
    End Function[/FONT][/COLOR]
 
Select is an extension method for Linq that was introduced with .Net 3.5, it is not available for .Net 2.0.
You can sort the List(Of T) using its Sort method with IComparison(Of T)/Comparer(Of T): List(T).Sort Method (System.Collections.Generic)
 

Latest posts

Back
Top