EnumTEnumTryParse(StringSegment, StringSegment, Boolean, TEnum) Method

Tries to convert the string representation of the name or numeric value of one or more enumerated values to an equivalent enumerated object. In case of success the return value is and parsed enum is returned in result parameter.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
C#
public static bool TryParse(
	StringSegment value,
	StringSegment separator,
	bool ignoreCase,
	out TEnum result
)

Parameters

value  StringSegment
The string representation of the enumerated value or values to parse.
separator  StringSegment
In case of more values specifies the separator among the values. If Null or Empty, then comma (,) separator is used.
ignoreCase  Boolean
If , ignores case; otherwise, regards case.
result  TEnum
Returns the default value of TEnum, if return value is ; otherwise, the parsed enum value.

Return Value

Boolean
if the StringSegment in value parameter cannot be parsed as TEnum; otherwise, .

Exceptions

See Also