我试图拆分列表框的一些元素时遇到问题...
那我在做什么:
问题是我不知道该怎么做...我已经看过this link和this one但是无法为我的项目改变它。
我知道YouTube链接是43个字符。
所以我要做的是:
对不起,如果有语法错误,英语不是我的母语。
在线评论
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'put each item in the list box into an array
Dim arrList() As String = ListBox1.Items.OfType(Of String).ToArray
'Trim each item in the array to a length of 43 characters
Dim arrURL() As String = (From url In arrList
Select url.Substring(0, 43)).ToArray
'Add the array as a Range to the items collection of the second list box
ListBox2.Items.AddRange(arrURL)
End Sub