I have a list of values, these are all a combination of letters and numbers, to make an ID, however on some occasions this can just simply be a 0.
I need to remove all occasions where this is a 0.
I've tried something like
For i = 0 the list.count - 1
If list(i) = "0" Then
list.RemoveAt(j)
End If
Next
Start from the end of the list and go backwards toward 0
For i = list.count - 1 to 0 Step -1
If list(i) = "0" Then
list.RemoveAt(j)
End If
Next
If you want to use linq with a lambda use Where to keep all items that are not equal to "0" and recreate the list with ToList
list = list.Where(function(value) value <> "0").ToList
The lamda in this case is the same as
Function IsNotZero(value As String) As Boolean
return value <> "0"
End Function