Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 533 Bytes

bool.md

File metadata and controls

18 lines (16 loc) · 533 Bytes

Extensions

Bool Category

using DotToolkit.Extensions;

ToBool

Converts the specified value to a boolean (bool). Return bool: The boolean representation of the value. If the value is non-zero, it returns true; otherwise, false. For strings, it will return true for values like "True", "true", "1", etc., and false for "False", "false", "0", etc.

int intValue = 1;
bool result = intValue.ToBool();
//-> true

string stringValue = "false";
bool resultString = stringValue.ToBool();
//-> false