OptionConverter ToBoolean Method | Apache log4net™ SDK Documentation

Converts a string to a Boolean value.

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

C#
VB
C++
F#
Copy

    public static bool ToBoolean(
    	string argValue,
    	bool defaultValue
    )

    Public Shared Function ToBoolean (
    	argValue As String,
    	defaultValue As Boolean
    ) As Boolean

    public:
    static bool ToBoolean(
    	String^ argValue,
    	bool defaultValue
    )

    static member ToBoolean :
            argValue : string *
            defaultValue : bool -> bool

#### Parameters

argValue
  Type: System
  String
  String to convert.
defaultValue
  Type: System
  Boolean
  The default value.

#### Return Value

Type: Boolean
The Boolean value of argValue.
Remarks

If argValue is "true", then true is returned. If argValue is "false", then false is returned. Otherwise, defaultValue is returned.

See Also

#### Reference

OptionConverter Class
log4net.Util Namespace