removeFirstElement function

Requirements.Internal.removeFirstElement  ยท source

Icon of removeFirstElement

Remove first part of one line of the log file (until \",\")

Extends Modelica.Icons.Function

Splits one line of the comma-separated log file at its first comma: element is the text before the comma (empty if the line starts with a comma), updatedLine the text after it (empty if the comma is the last character). Example: removeFirstElement("Violated,a,b") returns ("Violated", "a,b"). If the line contains no comma, element is the whole line and updatedLine is empty. Fields are not unquoted, so an element must not contain a comma.

Called repeatedly to read the fields of the log file written by printViolationsToLogFile and printStatisticsToLogFile, by getElements and printViolationsToOutput.

Inputs

NameTypeDescription
line inputStringOne line of log file

Outputs

NameTypeDescription
element outputStringRemoved element (without ',')
updatedLine outputString= line where part upto first \",\" is removed (if \",\" not present, updatedLine=\"\")