Public Shared Sub Filter(Of T)(ByVal Arry() As T, ByRef ReturnArry() As T, ByVal Str As T)
Dim Err As New Exception("Error in fucntion Filter!")
Try
Dim i As Integer = 0
Dim a As Integer = 0
Dim TmpArry() As T
ReDim TmpArry(Arry.Length)
For i = LBound(Arry) To UBound(Arry)
If Not Arry(i).Equals(Str) Then
TmpArry(i) = Arry(i)
End If
Next i
For i = LBound(TmpArry) To UBound(TmpArry)
If Not IsNothing(TmpArry(i)) Then
a = a + 1
End If
Next i
ReDim ReturnArry(a - 2) : a = 0
For i = LBound(TmpArry) To UBound(TmpArry)
If Not IsNothing(TmpArry(i)) Then
ReturnArry(a) = TmpArry(i)
End If
a = a + 1
Next i
Catch ex As Exception
Throw ex
End Try
End Sub
这个过程,错在哪儿?
怎么改?
[求助]请各位看一下 程序怎么改?谢谢!