Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static method: T? TryParse<T>(string, bool)

Declaration

public static T? TryParse<T>(
    string value,
    bool ignoreCase
)

Summary

Finds the enum value corresponding to the specified string.

Generic type parameters

T
  • Must derive from: System.ValueType.
  • Must have a default constructor.
  • Must be a non-nullable value type.
The enum type from which to retrieve the value.

Parameters

stringvalueA string containing the name or value to convert.
boolignoreCaseIf true, ignore case; otherwise, regard case.

Returns

The value if it was successfully converted; null otherwise.