| ObjectHelperParse Method (Type, String) |
Parses a string and converts it to the specified type (using the invariant culture).
Namespace: DigitalRuneAssembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax public static Object Parse(
Type type,
string value
)
Public Shared Function Parse (
type As Type,
value As String
) As Object
public:
static Object^ Parse(
Type^ type,
String^ value
)
static member Parse :
type : Type *
value : string -> Object
Parameters
- type
- Type: SystemType
The target type. - value
- Type: SystemString
The value.
Return Value
Type:
ObjectAn instance of the given type that represents the string value.
Exceptions Remarks
This method can parse values of types that
- implement System.IConvertible,
- have a static method Parse(string) or Parse(string, IFormatProvider), or
- have a TypeConverter.
A NotSupportedException is thrown for other types that do not have an
automatic mechanism for value conversion from string. Further, an exception can be thrown
if the given string is invalid.
See Also