標題: [發問] vb.net主控台應用的select case [打印本頁] 作者: edchen70 時間: 2015-6-26 14:07 標題: vb.net主控台應用的select case
下列是vb.net主控台應用的程式碼
Module Module1
Sub Main()
Dim var As Char, str As String
var = "z"c
Select Case var
Case "A" To "Z"
str = "大寫字母"
Case "a" To "z"
str = "小寫字母"
Case "0" To "9"
str = "阿拉伯數字"
Case Else
str = "非文數字資料"
End Select
Console.WriteLine("請輸入字元:")
var = Console.ReadLine()
Console.WriteLine("你輸入的字元是屬於:{0}", str)
Console.ReadKey()
End Sub
End Module
不知為什麼我執行時我隨便輸入(大寫或小寫字母或數字)都顯示"小寫字母",請問哪裡錯了呢?作者: mark15jill 時間: 2015-6-27 10:43