isLeap function in vb.net?

  • Thread starter Thread starter Garg
  • Start date Start date
G

Garg

Hi,

I want to use an equivalent of isLeap function in vb.net.
Please tell me what would that be?

ret1 = (isLeap(document.all("lstYear1").value)) ? 29 : 28;
 
I want to use an equivalent of isLeap function in vb.net.
Please tell me what would that be?

ret1 = (isLeap(document.all("lstYear1").value)) ? 29 : 28;

Assuming lstYear is a DropDownList, something like:

If DateTime.IsLeapYear(lstYear1.SelectedItem.Text) Then
ret1 = 29
Else
ret1 = 28
End If

I haven't tried the above, as I never use VB.NET...

I'm not sure if VB.NET has the ? "immediate if" operator - C# certainly
does. If not, maybe VB.NET has kept the old VB IIf(...?) syntax...?
 
Back
Top