正如我在图像中看到的,StrFriends是一个LIST而不是ARRAY。Array.Sort仅对数组有效,对列表无效。如果需要对列表进行排序,则需要将其转换为数组,如下所示:
Dim cave As List(Of String) = New List(Of String)
Array.Sort(cave.ToArray)
或仅以阵列形式运行:
dim cave as String() = {"j", "c", "a", "b"}
Array.Sort(cave)
或者
dim cave(0 to 3) as String
cave(0) = "j"
cave(1) = "c"
cave(2) = "a"
cave(3) = "b"
Array.Sort(cave)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句