Attempts to parse the specified string.
public static T? TryParse<T>(string? value)
where T : struct, Enum
| parameter | description |
|---|---|
| T | The enumerated value type. |
| value | The string. |
A strongly typed enumerated value; or null if the string could not be successfully parsed.
This method matches case.
Attempts to parse the specified string.
public static T? TryParse<T>(string? value, CaseSensitivity caseSensitivity)
where T : struct, Enum
| parameter | description |
|---|---|
| T | The enumerated value type. |
| value | The string. |
| caseSensitivity | The case sensitivity. |
A strongly typed enumerated value; null if the string could not be successfully parsed.
Attempts to parse the specified string.
public static bool TryParse<T>(string? value, out T result)
where T : struct, Enum
| parameter | description |
|---|---|
| T | The enumerated value type. |
| value | The string. |
| result | The resulting enumerated value. |
True if the string was successfully parsed.
This method matches case.
Attempts to parse the specified string.
public static bool TryParse<T>(string? value, CaseSensitivity caseSensitivity, out T result)
where T : struct, Enum
| parameter | description |
|---|---|
| T | The enumerated value type. |
| value | The string. |
| caseSensitivity | The case sensitivity. |
| result | The resulting enumerated value. |
True if the string was successfully parsed.
This method ignores case.