[求助]请问如何可以把相同出现次数的字符归为一类?
Private Sub Command2_Click()
Text2 = ""
Dim n(2) As String
Text1 = "你,我,他,他,他,他"
a1 = Text1.Text
n(0) = "你"
n(1) = "我"
n(2) = "他"
For j = 0 To 2
For l = 0 To Len(Text1)
i = UBound(Split(a1, n(j)))
If i = l Then
Text2 = Text2 & i & "次" & n(j) & vbCrLf
End If
Next l
Next j
'以上得到的效果为
'1次 你
'1次 我
'4次 他
'请问如何可以把相同次数的字符归为一类呢?
'如:
'1次 你,我
'4次 他
End Sub
望高手赐教,谢谢!