dim s as string = "谢谢大家了 Thanks 39 aaaThanks 3333339 99" For i as integer = 1 to s.length dim tt as integer = ASC(Mid(s,i,1))
if tt >= 65 and tt <= 90 then '为小写英文字母个数 n1 = n1 + 1 end if if tt >= 97 and tt <= 122 then '为大写英文字母个数 n2 = n2 + 1 end if if tt >= 48 and tt <= 57 then '为0~9数字个数 n3 = n3 + 1 end if if tt = 32 then '为空字符个数 n4 = n4 + 1 end if
if tt < 0 then '为汉字个数 n5 = n5 + 1 end if Next output.show("字母: " & n1+n2 & " 数字: " & n3 & " 空格: " & n4 & " 汉字: " & n5 & " " & z.len