TimeUtils.TryParseEnumFromMonthName method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Time
Assembly Skybrud.Essentials.dll

TryParseEnumFromMonthName(string, out EssentialsDateMonthName)

Static

Converts the specified monthName into an enum representation of the month (eg. August is the eight month of the year, and will result in August) and returns a value that indicates whether the conversion succeeded.

public static bool TryParseEnumFromMonthName(string monthName, EssentialsDateMonthName result)

Parameters

monthName String

The name of the month.

When this method returns, contains the EssentialsDateMonthName value equivalent to the month name contained in monthName, if the conversion succeeded, or the default value of EssentialsDateMonthName if the conversion failed. The conversion fails if monthName is null, is an empty string (""), or does not contain a valid month name. This parameter is passed uninitialized.

Returns

true if monthName was converted successfully; otherwise, false.

TryParseEnumFromMonthName(string, IFormatProvider, out EssentialsDateMonthName)

Static

Converts the specified monthName into an enum representation of the month (eg. August is the eight month of the year, and will result in August) and returns a value that indicates whether the conversion succeeded.

public static bool TryParseEnumFromMonthName(string monthName, IFormatProvider provider, EssentialsDateMonthName result)

Parameters

monthName String

The name of the month.

provider IFormatProvider

An object that supplies culture-specific format information about monthName.

When this method returns, contains the EssentialsDateMonthName value equivalent to the month name contained in monthName, if the conversion succeeded, or the default value of EssentialsDateMonthName if the conversion failed. The conversion fails if monthName is null, is an empty string (""), or does not contain a valid month name. This parameter is passed uninitialized.

Returns

true if monthName was converted successfully; otherwise, false.