So, the index of the shortest string?
There are ways to do it that use less code, but they are probably slower than the old fashioned way:
Code:dim minIndex as integer dim minLength as integer = Integer.Max For x = 0 to listbox.Items.Count -1 if listbox.Items(x).Length < minLength Then minLength = listbox.Items(x).Length minindex=x End If Next






Reply With Quote