| Description |
|
Attempts to parse the Value string into a true or false value, returning a Boolean object with the appropriate value.
|
| | Notes | Warning : An exception is thrown if the parse encounters unexpected characters.
|
|
| Microsoft MSDN Links |
System
System.Boolean
|
|
|
| A simple example |
program Project1;
{$APPTYPE CONSOLE}
var
boolStr : String;
begin
boolStr := 'true';
if System.Boolean.Parse(boolStr)
then Console.WriteLine('''' + boolStr + ''' parses to true')
else Console.WriteLine('''' + boolStr + ''' parses to false');
boolStr := ' True ';
if System.Boolean.Parse(boolStr)
then Console.WriteLine('''' + boolStr + ''' parses to true')
else Console.WriteLine('''' + boolStr + ''' parses to false');
boolStr := ' FALSE ';
if System.Boolean.Parse(boolStr)
then Console.WriteLine('''' + boolStr + ''' parses to true')
else Console.WriteLine('''' + boolStr + ''' parses to false');
Console.ReadLine;
end.
| | Show full unit code | 'true' parses to true
' True ' parses to true
' FALSE ' parses to false
|
| |
|
|
|