EnumTEnumTryParse(String, String, 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.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
public static bool TryParse(
string value,
string? separator,
bool ignoreCase,
out TEnum result
)
Public Shared Function TryParse (
value As String,
separator As String,
ignoreCase As Boolean,
<OutAttribute> ByRef result As TEnum
) As Boolean
public:
static bool TryParse(
String^ value,
String^ separator,
bool ignoreCase,
[OutAttribute] TEnum% result
)
static member TryParse :
value : string *
separator : string *
ignoreCase : bool *
result : 'TEnum byref -> bool
- value String
- The string representation of the enumerated value or values to parse.
- separator String
- In case of more values specifies the separator among the values. If or is 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.
Boolean if the
string in
value parameter cannot be parsed as
TEnum; otherwise,
.