[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'sysutils' (#rtl)

StrToBool

Convert a string to a boolean value

Declaration

Source position: sysstrh.inc line 160

function StrToBool(

  const S: String

):Boolean;

Description

StrToBoolwill convert the string Sto a boolean value. The string Scan contain one of 'True', 'False'(case is ignored) or a numerical value. If it contains a numerical value, 0 is converted to False, all other values result in True. If the string Scontains no valid boolean, then an EConvertErrorexception is raised.

Errors

On error, an EConvertErrorexception is raised.

See also

BoolToStr

  

Convert a boolean value to a string.