参照这个
Dim dic As New Dictionary(of Integer,String)
Dim s() As String = {"输","输","赢","赢","输","输","赢","输","输"}
Dim i As Integer = 0
Dim count As Integer =0
Dim current As String
For Each s1 As String In s
If s1<> current Then
count = 1
i+=1
dic.Add(i,s1 & count)
current = s1
Else
count +=1
dic(i) = s1 & "|" & count
End If
Next
For Each k As Integer In dic.Keys '显示所有键及其对应的值
Output.Show(K & ":" & dic(k))
Next
[此贴子已经被作者于2015/8/29 19:18:04编辑过]