OptionConverter ConvertStringTo Method | Apache log4net™ SDK Documentation

Converts a string to an object.

Namespace: log4net.Util
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public static Object ConvertStringTo(
    	Type target,
    	string txt
    )

    Public Shared Function ConvertStringTo (
    	target As Type,
    	txt As String
    ) As Object

    public:
    static Object^ ConvertStringTo(
    	Type^ target,
    	String^ txt
    )

    static member ConvertStringTo :
            target : Type *
            txt : string -> Object

#### Parameters

target
  Type: System
  Type
  The target type to convert to.
txt
  Type: System
  String
  The string to convert to an object.

#### Return Value

Type: Object
The object converted from a string or null when the conversion failed.
Remarks

Converts a string to an object. Uses the converter registry to try to convert the string value into the specified target type.

See Also

#### Reference

OptionConverter Class
log4net.Util Namespace