TryParse()

Enum::TryParse(const String&, E&) method

Tries to convert the specified string into equivalent enum constant.

static bool System::Enum<E, Guard>::TryParse(const String &str, E &result)

Arguments

ParameterTypeDescription
strconst String&String that is interpreted as containing the name of enum constant
resultE&The output parameter that if conversion succeeds contains the result of conversion on function

Return Value

True if conversion succeeded, otherwise - false

Enum::TryParse(const String&, bool, E&) method

Tries to convert the specified string into equivalent enum constant.

static bool System::Enum<E, Guard>::TryParse(const String &str, bool ignoreCase, E &result)

Arguments

ParameterTypeDescription
strconst String&String that is interpreted as containing the name of enum constant
ignoreCaseboolSpecifies if the case should be ignored when interpreting the string
resultE&The output parameter that if conversion succeeds contains the result of conversion on function return

Return Value

True if conversion succeeded, otherwise - false

See Also