Sorting array warning when migrating to .NET 3.5
I've just converted my VB.NET application from .NET 1.1 to 3开发者_开发技巧.5, and I'm getting the warning message
Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.
in
Private Function reOrderArray(ByVal arr() As String) As String
arr.Sort(arr) 'Sort array alphabetically
'More code...
return arr
End Function
for the words arr.Sort
on the second line.
What is causing this?
Array.Sort
is a static/shared method, and should be invoked appropriately:
Array.Sort(arr)
精彩评论