Private Sub Command1_Click()
Dim a As String
Dim e As Integer
Dim n As Integer
Dim x As Integer
Dim i As Integer
a = InputBox("", "", "aabb23!@#$%")
For i = 1 To Len(a)
Select Case Mid(a, i, 1)
Case "a" To "z", "A" To "Z"
e = e + 1
Case 0 To 9
n = n + 1
Case Else
x = x + 1
End Select
Next
Print a
Print e; n; x
End Sub
Private Sub Command1_Click()
Dim str As String
Dim a As Integer, b As Integer, c As Integer, d As Integer, ia As Integer
str = Text1.Text
For a = 1 To Len(str)
ia = Asc(Mid(str, a, 1))
If ia >= 65 And ia <= 90 Or ia >= 97 And ia <= 122 Then
b = b + 1
ElseIf ia >= 48 And ia <= 57 Then
c = c + 1
Else
d = d + 1
End If
Next
Print "字母:" & b
Print "数字:" & c
Print "其它:" & d
End Sub