Imports System
Imports System.Collections.Generic
Public Class Program
Public Shared Function RemoveElements(ByVal arr As Integer(), ByVal value As Integer) As Integer()
Dim result = New List(Of Integer)()
For Each item In arr
If item <> value Then
result.Add(item)
End If
Next
Return result.ToArray()
End Function
Public Shared Sub Main(ByVal args As String())
Dim array As Integer() = {1, 3, 8, 23, 8, 99, 8, 100, 7}
Dim value As Integer = 8
array = RemoveElements(array, value)
Console.WriteLine(String.Join(", ", array))
End Sub
End Class
' run:
'
' 1, 3, 23, 99, 100, 7
'