VB中统计大小写字母及数字个数代码怎么写

2020-08-31 教育 323阅读
Private Sub Command1_Click()
Dim a As String,dx As Integer
Dim xx As Integer,sz As Integer
a = "ASDFasdfASDFYZ0123asdfyz456789"
For i = 1 To Len(a)
Select Case Mid(a,i,1)
Case "0" To "9"
sz = sz + 1
Case "A" To "Z"
dx = dx + 1
Case "a" To "z"
xx = xx + 1
End Select
Next
MsgBox "大写" & dx & "小写" & xx & "数字" & sz
End Sub
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com