System Namespace Enum Class
Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object.
[ VB ]
<Serializable>
Overloads Public Shared Function Parse ( _
ByVal enumType As Type, _
ByVal value As String _
) As Object
[ C# ]
[Serializable]
public static object Parse (
Type enumType,
string value
);
[ C++ ]
[Serializable]
public: static Object* Parse (
Type* enumType,
String* value
);
[JScript ]
public Serializable
static function Parse (
enumType : Type,
value : String
) : Object;
- enumType
- The Type of the enumeration.
- value
- A string containingthe name or value to convert.
An object of type enumType whose value is represented by value.
Exception Type |
Condition |
ArgumentNullException |
enumType or value is a null reference ( Nothing in Visual Basic ). |
ArgumentException |
enumType is not an Enum.
-or-
value is either an empty string or only contains white space.
-or-
value is a name, but not one of the named constants defined for the enumeration.
|
The value parameter contains a value, a named constant, or a list of named constants delimited by commas ( , ). One or more blanks spaces can precede or follow each value, name, or comma in value. If value is a list, the return value is the value of the specified names combined with a bitwise OR operation.
This operation is case-sensitive.
Enum Members Enum.Parse Overload List