Converts a string to a numeric value.

Namespace: Simol.Formatters
Assembly: Simol (in Simol.dll) Version: 1.0.0.0

Syntax

C#
public virtual Object ToType(
	string valueString,
	Type expected
)
Visual Basic
Public Overridable Function ToType ( _
	valueString As String, _
	expected As Type _
) As Object
Visual C++
public:
virtual 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

Implements

ITypeFormatter..::..ToType(String, Type)

Exceptions

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

See Also