asp.net.ph

Enum.Parse Method ( Type, String )

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;

Parameters

enumType
The Type of the enumeration.
value
A string containingthe name or value to convert.

Return Value

An object of type enumType whose value is represented by value.

Exceptions


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.


Remarks

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.

See Also

Enum Members   Enum.Parse Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph