[CODE]Private Sub Command1_Click()
Dim strTemp As String
Dim strArr() As String
Dim llCount As Long
Dim i As Integer, j As Integer
strTemp = Text1
i = 0
For llCount = 1 To Len(strTemp)
If Mid$(strTemp, llCount, 1) Like "[^a-z]" Then
i = i + 1
ReDim Preserve strArr(i) As String
strArr(i) = Mid$(strTemp, llCount, 1)
End If
Next
'排序
Text2 = ""
Dim tmp As String
For i = 1 To UBound(strArr)
For j = i + 1 To UBound(strArr)
If strArr(i) > strArr(j) Then
'交换两数
tmp = strArr(i)
strArr(i) = strArr(j)
strArr(j) = tmp
End If
Next j
Next i
i = 0
For llCount = 1 To Len(strTemp)
If Mid$(strTemp, llCount, 1) Like "[^a-z]" Then
i = i + 1
Text2 = Text2 & strArr(i)
Else
Text2 = Text2 & Mid$(strTemp, llCount, 1)
End If
Next
End Sub
Private Sub Form_Load()
Text1 = "ccbb1aa4ggff1ee"
Text2 = ""
End Sub[/CODE]
这下看懂了吧! 哎