vb.net.问题:通过文本框输入一串字符,单击命令按钮,要求分别统计字符串中所含字母和数字的个数。

2024-10-31 19:56:38
推荐回答(2个)
回答1:

要改成这样;
for i = 1 to Len(s)
j = Mid(s,i,1)
select case j
case "a" to "z","A" to "Z"
C = C + 1
CASE "0" TO "9"
D = D + 1
CASE ELSE
M= M+1
END SELECT
NEXT

回答2:

Next要放到End Select后面一行