Provides TryParse method, for parsing enumerations.
More...
|
| static bool | TryParse< TEnum > ([NotNull] string value, out TEnum output, bool ignoreCase) |
| | Tries to parse a given value as an enumeration. Even if value is numeric, this method still ensures that given number is among the enumerated constants. This differs in behavior from Enum.Parse, which accepts any valid numeric string (that fits into enumeration's base type).
|
| |
Provides TryParse method, for parsing enumerations.
| static bool fCraft.EnumUtil.TryParse< TEnum > |
( |
[NotNull] string |
value, |
|
|
out TEnum |
output, |
|
|
bool |
ignoreCase |
|
) |
| |
|
static |
Tries to parse a given value as an enumeration. Even if value is numeric, this method still ensures that given number is among the enumerated constants. This differs in behavior from Enum.Parse, which accepts any valid numeric string (that fits into enumeration's base type).
- Template Parameters
-
- Parameters
-
| value | Raw string value to parse. |
| output | Parsed enumeration to output. Set to default(TEnum) on failure. |
| ignoreCase | Whether parsing should be case-insensitive. |
- Returns
- Whether parsing succeeded.
- Exceptions
-
| ArgumentNullException | value is null. |
The documentation for this class was generated from the following file: