我正在使用以下代码拆分字符串并检索它们:
Private Sub Button1_Click(sender As Object, e As EventArgs)
Handles Button1.Click
Dim s As String = "a,bc,def,ghij,klmno"
Dim parts As String() = s.Split(New Char() {","c})
Dim part As String
For Each part In parts
MsgBox(part(0))
Next
End Sub
但消息框仅显示每个 splitted 中的第一个字符string (a,b,d,g,k)
。
我只想显示第一个单词,我做错了什么?