用Vb设计一个程序判断大写字母和小写字母

来源:百度知道 编辑:UC知道 时间:2024/09/28 10:28:33
输入一个字母,判断是大写字母还是小写字母

XOooZzz 谢谢 我第一次看到这个 受益匪浅
有用..
我的是:
Dim str As String
str = inputBox("Input","Input a String") '字符
Select Case str
Case "a" To "z"
MsgBox "小写"
Case "A" To "Z"
MsgBox "大写"
Case 0 to 9
MsgBox "数字"
Case Else
Msgbox "不是字母也不是数字!"
End Select

这个可能用途广泛一点也好用一点

private sub command1_click()
temp=inputbox("输入一个字母")
if ucase(temp)=temp then
msgbox "大写字母"
else
mesbox "小写字母"
end if
end sub

if str like "*[a-z]*" then print "包含小写字母"