我已經找到堆棧溢出下面的代碼這段代碼是從二維數組中刪除行,它成功地在C#中工作,我的問題是將它轉換爲vb.net,當我轉換它時它不起作用。任何幫助,請從二維數組中刪除行
Public Function TrimArray(ByVal rowToRemove As Integer, ByVal originalArray As Integer(,)) As Integer(,)
Dim result As Integer(,) = New Integer(originalArray.GetLength(0) - 2, originalArray.GetLength(1) - 1) {}
Dim i As Integer = 0, j As Integer = 0
While i < originalArray.GetLength(0)
If i = rowToRemove Then
Continue While
End If
Dim p As Integer = 0, m As Integer = 0
While p < originalArray.GetLength(1)
result(j, m) = originalArray(i, p)
m += 1
p += 1
End While
j += 1
i += 1
End While
Return result
End Function
你試過嗎? http://converter.telerik.com/ – Werdna
顯示您的轉換後的代碼,並告訴我們什麼「不起作用」 –
是的。我試過了很多轉換器 – rasha