Converts a string to a specified type.
Namespace: SimolAssembly: Simol (in Simol.dll) Version: 1.0.0.0
Syntax
C# |
---|
Object ToType( string valueString, Type expected ) |
Visual Basic |
---|
Function ToType ( _ valueString As String, _ expected As Type _ ) As Object |
Visual C++ |
---|
Object^ ToType( String^ valueString, Type^ expected ) |
Parameters
- valueString
- Type: System..::..String
The string value to convert.
- expected
- Type: System..::..Type
The expected type of the returned object.
Return Value
The converted object or nullExceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | If the valueString parameter is null |
System..::..ArgumentException | If the expected parameter is an unsupported type |