MonthName Function in VB.NET

What is the use of monthname function in VB.NET?


MonthName Function

This Function in Visual 2008 returns a string containing the name of the specifiedmonth.

MonthName(Month, Abbreviates)

In the above example, 'month' is represented as an integer value, the 'Abbreviates' is an optional argument which is represented as boolean.

Module Module1
Sub Main()
Console.WriteLine("Name of the month is:: " & MonthName(12))
Console.WriteLine("Abbreviated name of month is::"
& MonthName(12, True))
End Sub
End Module

Name of the month is:: December
Abbreviated name of month is:: Dec

In the above monthname function example, the first the name of the month is displayed completly. Then optional abbreviation is is set to true to display the abbreviated name of the month.

Visual Basic Tutorial

Ask Questions

Ask Question