Is there a C# equivalent of VB6's Choose() function?
day = Choose(month,31,28,30)
Senior Member. You read it as "ei-cee" (no "slash" pronounced). In terms of distinguishing between "air conditioning" and "air conditioner," I can think of an example like "Today, I bought a new air conditioner" ("conditioning" not allowed). I personally would not say "Today, I bought a new AC."
uncountable noun. a/ c is an abbreviation for air-conditioning. Keep your windows up and the a/c on high.
Air conditioning, often abbreviated as A/C or AC, is the process of removing heat from an enclosed space to achieve a more comfortable interior environment (sometimes referred to as 'comfort cooling') and in some cases also strictly controlling the humidity of internal air.
Not really. You can of course create an array an use its indexed getter:
day = new[] { 31, 28, 30 }[month];
Alternatively, you could - I wouldn't - import the Microsoft.VisualBasic
namespace and do:
day = Interaction.Choose(month, 31, 28, 30);
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()
:
day = DateTime.DaysInMonth(2008, 2);
// day == 29
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With