Converts a string to boolean.
True, if the string is "true", false, if the string is "false", otherwise the default value.
Only the values 'true' or 'false' are recognized. For all other values, the default will be returned. The comparison is case-insensitive.
bool b0 = MainUtil.StringToBool("True", true); // true
bool b1 = MainUtil.StringToBool("false", true); // false
bool b0 = MainUtil.StringToBool("", true); // true
bool b0 = MainUtil.StringToBool("abc", false); // false
bool b0 = MainUtil.StringToBool("yes", false); // false
bool b0 = MainUtil.StringToBool("1", false); // false
MainUtil Class | Sitecore Namespace | BoolToString