functionscanDelimiter
Scan for the next delimiter and trigger an assert if not present
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
delimiter = Strings.scanDelimiter(string);
(delimiter, nextIndex) = Strings.scanDelimiter(string, startIndex=1,
requiredDelimiters={","}, message="");
Description
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.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | string | String to be scanned | |
| Integer | startIndex | 1 | Start scanning of delimiters at character startIndex |
| String[:] | requiredDelimiters | {","} | Delimiters that are searched |
| String | message | "" | Message used in error message if scan is not successful |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | delimiter | Found delimiter | |
| Integer | nextIndex | Index of character after the found delimiter |
Contents
| Name | Description |
|---|---|
| Concatenate strings together |