无效的表达式术语字符串



我正在尝试获取

 Console.WriteLine("Please enter a day of the week, e.g. Tue: ");
 today =  Console.ReadLine();
 GotoWork = string (today != SUN && today != SAT) ?
              Console.WriteLine("You have to go to work today...") ; 
              Console.WriteLine("Ahh... the weekend. No work!");'

编译并告诉我是否需要去上班,但它告诉我"(今天!= SUN && 今天!= SAT)"是一个

invalid expression term for string.

用双引号括起来SUNSAT,因为这是字符串的表示方式。

today != "SUN" && today != "SAT"

最新更新