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: 6.0.0+cfb73701cda54e2410b006f649f072e90daef707
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 if the input value could not be parsed
See Also