I have
As you can see the string will always END with a comma.Code:Dim items = String.Empty For Each i In ListBox2.Items items = i & ", " & items Next
This is fine because when i retrieve the string from the db, i just use the split function.
BUT its something i want to stay away from.
These are the ways I thought of removing it.
1) do some string manipulation and remove the comma at the end.
2) instead of for loop, do a normal loop with a counter. when the counter reaches the last one, throw a if statement and concatenate without the comma.
so whats the best way




Reply With Quote