vb中在一段字母中有大小写,怎样分别计算大.小写字母的个数

2022-08-16 教育 63阅读
dim ss as string, s as string, dx as integer, xx as integer, i as integer
ss="sREadsGadsaBVhVgdsNaNfBdweNgBjNiNlBNeBrNiogyiChXCgXkDFnDbHlnNklbNv"
for i=1 to len(ss)
s=mid(ss,i,1)
if s>="A" and s<="Z" then
dx=dx+1
elseif s>="a" and s<="z" then
xx=xx+1
end if
next
msgbox "大写字母" & dx & "个" & vbcrlf & "小写字母" & xx & "个"
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com