Is there a C# equivalent of VB6’s Choose() function?
day = Choose(month,31,28,30)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not really. You can of course create an array an use its indexed getter:
Alternatively, you could – I wouldn’t – import the
Microsoft.VisualBasicnamespace and do:I do not know how much your example is simplified, but in the case that you are actually looking for a way to find the numbers of days in a specific month, try
DateTime.DaysInMonth():