.Modelica.Utilities.Strings.substring

Information

Syntax

string2 = Strings.substring(string, startIndex, endIndex);

Description

This function returns the substring from position startIndex up to and including position endIndex of "string" .

If index, startIndex, or endIndex are not correct, e.g., if endIndex > length(string), an assert is triggered.

Example

string1 := "This is line 111";
string2 := Strings.substring(string1,9,12); // string2 = "line"

Interface

pure function substring
  extends Modelica.Icons.Function;
  input String string "String from which a substring is inquired";
  input Integer startIndex(min = 1) "Character position of substring begin (index=1 is first character in string)";
  input Integer endIndex(min = 1) "Character position of substring end";
  output String result "String containing substring string[startIndex:endIndex]";
end substring;

Generated at 2020-06-05T21:39:08Z by OpenModelica 1.16.0~dev-442-g2e5bc9f