scanDelimiterScan for the next delimiter and trigger an assert if not present |
This information is part of the Modelica Standard Library maintained by the Modelica Association.
delimiter = Strings.scanDelimiter(string); (delimiter, nextIndex) = Strings.scanDelimiter(string, startIndex=1, requiredDelimiters={","}, message="");
Function scanDelimiter scans the string starting at index "startIndex", checks whether the next token is a delimiter string and returns its value as a string, as well as the index directly after the delimiter. An assert is triggered, if the scanned string does not contain a delimiter out of the list of requiredDelimiters. Input argument requiredDelimiters is a vector of strings. The elements may have any length, including length 0. If an element of the requiredDelimiters is zero, white space is treated as delimiter. The function returns delimiter="" and nextIndex is the index of the first non white space character.
string |
Type: String Description: String to be scanned |
---|---|
startIndex |
Default Value: 1 Type: Integer Description: Start scanning of delimiters at character startIndex |
requiredDelimiters |
Default Value: {","} Type: String[:] Description: Delimiters that are searched |
message |
Default Value: "" Type: String Description: Message used in error message if scan is not successful |
delimiter |
Type: String Description: Found delimiter |
---|---|
nextIndex |
Type: Integer Description: Index of character after the found delimiter |