How to get Javascript array length?

Sorting a two dimensional array in vb.net?

  • Can't seem to get it working, any ideas? Module Module1 Dim Array(3, 1) As String Sub InsertionSort(ByRef Array(ArraySize, 1) As String) Dim CurrentValue As Integer For CurrentValue = 0 To Array.Length - 1 Dim Pointer As Integer, Value As String = Array(0, CurrentValue) For Pointer = CurrentValue - 1 To 0 Step -1 If Array(0, Pointer) <= Value Then Exit For Array(0, Pointer + 1) = Array(0, Pointer) Next Array(0, Pointer + 1) = Value Next End Sub Sub Main() Array(0, 1) = "c" Array(1, 1) = "a" Array(2, 1) = "t" Array(3, 1) = "s" Dim ArraySize As Integer = Array.GetUpperBound(0) Dim CurrentValue As Integer InsertionSort(Array(ArraySize, 1)) For CurrentValue = 0 To Array.Length - 1 Console.WriteLine(Array(CurrentValue, 1)) Next For CurrentValue = 1 To Array.Length - 1 If Array(CurrentValue - 1, 1) > Array(CurrentValue, 1) Then Console.WriteLine("ERROR") End If Next End Module

  • Answer:

    You should use linq it's much more powerful, you just convert your array to a list, then use linq. It can do the sorting as well.

VinylSea... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.