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. A parameter specifies whether the operation is case-sensitive.
[ VB ]
<Serializable>
Overloads Public Shared Function Parse ( _
ByVal enumType As Type, _
ByVal value As String, _
ByVal ignoreCase As Boolean _
) As Object
[ C# ]
[Serializable]
public static object Parse (
Type enumType,
string value,
bool ignoreCase
);
[ C++ ]
[Serializable]
public: static Object* Parse (
Type* enumType,
String* value,
bool ignoreCase
);
[JScript ]
public Serializable
static function Parse (
enumType : Type,
value : String,
ignoreCase : Boolean
) : Object;
- enumType
- The Type of the enumeration.
- value
- A string containing the name or value to convert.
- ignoreCase
- If true, ignore case; otherwise, regard case.
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.
The ignoreCase parameter specifies whether this operation is case-sensitive.
Enum Members Enum.Parse Overload List