CodeCarvings.Piczard
StringToBool(String,String,String,Boolean,Boolean) Method
See Also  Send Feedback
CodeCarvings.Piczard.Helpers Namespace > StringConversionHelper Class > StringToBool Method : StringToBool(String,String,String,Boolean,Boolean) Method

value
A string that represents a bool value.
trueValue
The string that identifies the true value.
falseValue
The string that identifies the false value.
ignoreCase
true to ignore case during the comparison; otherwise, false.
defaultValue
The default value to return in case the provided string is not valid.
Converts a string to a bool value using the specified tokens.

Syntax

Visual Basic (Declaration)  
Public Overloads Shared Function StringToBool( _
   ByVal value As String, _
   ByVal trueValue As String, _
   ByVal falseValue As String, _
   ByVal ignoreCase As Boolean, _
   ByVal defaultValue As Boolean _
) As Boolean
C#  
public static bool StringToBool( 
   string value,
   string trueValue,
   string falseValue,
   bool ignoreCase,
   bool defaultValue
)

Parameters

value
A string that represents a bool value.
trueValue
The string that identifies the true value.
falseValue
The string that identifies the false value.
ignoreCase
true to ignore case during the comparison; otherwise, false.
defaultValue
The default value to return in case the provided string is not valid.

Return Value

The value converted from the provided string.

Requirements

Platforms: Windows 8, Windows 7, Windows Vista, Windows XP Professional, Windows 2000 - Windows Server family: 2012, 2008.R2, 2008, 2003, 2000

See Also

©2013 Sergio Turolla. All Rights Reserved.