substringReturn a substring defined by start and end index |
This information is part of the Modelica Standard Library maintained by the Modelica Association.
string2 = Strings.substring(string, startIndex, endIndex);
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.
string1 := "This is line 111"; string2 := Strings.substring(string1,9,12); // string2 = "line"
string |
Type: String Description: String from which a substring is inquired |
---|---|
startIndex |
Type: Integer Description: Character position of substring begin (index=1 is first character in string) |
endIndex |
Type: Integer Description: Character position of substring end |
result |
Type: String Description: String containing substring string[startIndex:endIndex] |
---|