Private Sub Command1_Click()
Dim i As Integer,count As Integer,length As Integer
Dim ch As String,key As String,s As String
S=Text1.Text
length=Len(s)
key= ①
i=2:count=1
Do While i<=length
ch=Mid(s,i,1)
If ch=key Then
count=count+1
Else
Text2.Text=Text2.Text+Str(count)+key
count=1
key=ch
End If
②
Loop
Text2.Text=Text2.Text+Str(count)+key ‘③
End Sub
① ②