Converts a string to a specified type.

Namespace: Simol
Assembly: 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 null

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionIf the valueString parameter is null
System..::..ArgumentExceptionIf the expected parameter is an unsupported type

See Also