- Dim SortString1 As String
- Dim Chars1() As Char
- Dim iCount As Integer
- SortString1 = InputBox("输入比较字符串", "字符", "Test")
- ReDim Chars1(SortString1.Length - 1)
- For iCount = 0 To SortString1.Length - 1
- Chars1.SetValue(SortString1.Chars(iCount), iCount)
- Next
- Array.Sort(Chars1)
- Label1.Text = Chars1
输入一个字符串
用数组获取到字符串中的每个字符
排序
输出