我正在尝试将逗号分隔的值添加到组合框中。问题是我不知道这是否是将值拆分为组合框的最佳方法。有更清洁/有效的方法吗?:
Dim toread As String
toread = ini.ReadValue("Schools", "Schools")
Dim textdelimiter As String
textdelimiter = ","
Dim splitout = Split(toread, textdelimiter)
Dim i As Integer
For i = 0 To UBound(splitout)
ComboBox1.Items.Add(splitout(i))
Next
答案 0 :(得分:4)
你可以试试这个:
ComboBox1.Items.AddRange(ini.ReadValue("Schools", "Schools").Split(",").ToArray)