vb写程序输入一个字符,判断是数字字符?大小字母?其他字符?
答案:3 悬赏:60 手机版
解决时间 2021-03-20 18:46
- 提问者网友:听门外雪花风
- 2021-03-19 19:01
vb写程序输入一个字符,判断是数字字符?大小字母?其他字符?
最佳答案
- 五星知识达人网友:舊物识亽
- 2021-03-19 19:17
If Asc(Text1.Text) < "58" And Asc(Text1.Text) > "47" Then
MsgBox "数字"
ElseIf Asc(Text1.Text) < "91" And Asc(Text1.Text) > "64" Then
MsgBox "大写字母"
ElseIf Asc(Text1.Text) < "123" And Asc(Text1.Text) > "96" Then
MsgBox "小写字母"
ElseIf Asc(Text1.Text) < 0 Then
MsgBox "汉字或其他字符"
Else
MsgBox "其他字符"
End If
MsgBox "数字"
ElseIf Asc(Text1.Text) < "91" And Asc(Text1.Text) > "64" Then
MsgBox "大写字母"
ElseIf Asc(Text1.Text) < "123" And Asc(Text1.Text) > "96" Then
MsgBox "小写字母"
ElseIf Asc(Text1.Text) < 0 Then
MsgBox "汉字或其他字符"
Else
MsgBox "其他字符"
End If
全部回答
- 1楼网友:傲气稳了全场
- 2021-03-19 21:20
private sub form_click()
dim a as string
a=inputbox(“一个字符”,“输入”,“0”)
if a>=“0” and a<=“9” print a;“是一个数字”
elseif a>=“a” and a<=“z” print a;“是一个小写字母”
elseif a>=“A” and a<=“Z” print a;“是一个大写字母”
elseif print a;“是一个其他字符”
end sub
- 2楼网友:醉吻情书
- 2021-03-19 19:43
dim a as string
a=inputbox("请输入一个字符")
select case a
case "0" to "9"
msgbox "是数字"
case "a" to "z","a" to "z"
msgbox "是字母"
case else
msgbox "是其它字符"
end select
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯