I am trying to convert a for next loop into a do loop because I want to add a condition.
This code works perfectly:
Dim LastNonEmpty As Integer = -1 For i As Integer = 0 To mnar.Length - 1 If mnar(i) <> "" Then LastNonEmpty += 1 mnar(LastNonEmpty) = mnar(i) End If Next
But when I converted it:
i = 0 Do while i = wnar.Length - 1 If wnar(i) <> "" Then LastNonEmpty2 += 1 wnar(LastNonEmpty2) = wnar(i) End If Loop
This doesn't work at all.
Please suggest me the correct code.
Or tell me how to add condition in a for next loop.