程序代码:
Private Sub Form_Click()
Dim i As Integer, j As Integer
j = 0 ‘ 计数
Dim str As String
str = "abcs123"
For i = 1 To Len(str)
If IsNumeric(Mid(str, i, 1)) Then ‘判断是否为数字
j = j + 1
End If
Next i
Print j
End Sub
2022-05-04 04:53:20
程序代码:
Private Sub Form_Click()
Dim i As Integer, j As Integer
j = 0 ‘ 计数
Dim str As String
str = "abcs123"
For i = 1 To Len(str)
If IsNumeric(Mid(str, i, 1)) Then ‘判断是否为数字
j = j + 1
End If
Next i
Print j
End Sub