scanBooleanScan for the next Boolean number and trigger an assert if not present |
This information is part of the Modelica Standard Library maintained by the Modelica Association.
number = Strings.scanBoolean(string); (number, nextIndex) = Strings.scanBoolean(string, startIndex=1, message="");
Function scanBoolean scans the string starting at index "startIndex", checks whether the next token is a Boolean literal (i.e., is either the string "false" or "true", if converted to lower case letters) and returns its value as a Boolean number, as well as the index directly after the Boolean number. An assert is triggered, if the scanned string does not contain a Boolean literal with optional leading white space.
string |
Type: String Description: String to be scanned |
---|---|
startIndex |
Default Value: 1 Type: Integer Description: Start scanning of string at character startIndex |
message |
Default Value: "" Type: String Description: Message used in error message if scan is not successful |
number |
Type: Boolean Description: Value of Boolean |
---|---|
nextIndex |
Type: Integer Description: Index of character after the found number |