Click or drag to resize

ConversionHelpersTryParseEnumTEnum Method

Converts input string value into Enum. Parsing is case-insensitive.

Namespace:  NLog.Common
Assembly:  NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
public static bool TryParseEnum<TEnum>(
	string inputValue,
	out TEnum resultValue,
	TEnum defaultValue = null
)
where TEnum : struct, new()

Parameters

inputValue
Type: SystemString
Input value
resultValue
Type: TEnum
Output value
defaultValue (Optional)
Type: TEnum
Default value

Type Parameters

TEnum

Return Value

Type: Boolean
Returns false if the input value could not be parsed
See Also