I am using the following VB.net code to delete all the items in a DropDownList that
contain commas - the problem is that because items get deleted, the count of items
changes and the code errors out because it runs over the index count. Ho do I avoid this ?
For k As Integer = 0 To L.Items.Count - 1
s = L.Items(k).Text
If InStr(s, ",") > 0 Then
'Delete item because comma was in it