MonthName Function in VB.NET
What is the use of monthname function in VB.NET?
Explanation
MonthName Function
This Function in Visual Basic.net 2008 returns a string containing the name of the specifiedmonth.
Syntax:
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.
Example:
Module Module1
Sub Main()
Console.WriteLine("Name of the month is:: " & MonthName(12))
Console.WriteLine("Abbreviated name of month is::"
& MonthName(12, True))
Console.ReadLine()
End Sub
End Module
Result:
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.