EnumTEnumParse(StringSegment, StringSegment, Boolean) Method

Converts the string representation of the name or numeric value of one or more enumerated values to an equivalent enumerated object.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
C#
public static TEnum Parse(
	StringSegment value,
	StringSegment separator = default,
	bool ignoreCase = false
)

Parameters

value  StringSegment
The string representation of the enumerated value or values to parse.
separator  StringSegment  (Optional)
In case of more values specified the separator among the values. If Null or Empty, then comma (,) separator is used. This parameter is optional.
Default value: Null.
ignoreCase  Boolean  (Optional)
If , ignores case; otherwise, regards case. This parameter is optional.
Default value: .

Return Value

TEnum
The parsed enum value.

Exceptions

ArgumentNullExceptionvalue is Null.
ArgumentExceptionvalue cannot be parsed as TEnum.

See Also