.Modelica.Utilities.Strings.sort

Information

Syntax

stringVector2 = Streams.sort(stringVector1);
stringVector2 = Streams.sort(stringVector1, caseSensitive=true);

Description

Function sort(..) sorts a string vector stringVector1 in lexicographical order and returns the result in stringVector2. If the optional argument "caseSensitive" is false, lower and upper case letters are not distinguished.

Example

s1 = {"force", "angle", "pressure"};
s2 = Strings.sort(s1);
     -> s2 = {"angle", "force", "pressure"};

Interface

function sort
  extends Modelica.Icons.Function;
  input String stringVector1[:] "Vector of strings";
  input Boolean caseSensitive = true "= false, if lower and upper case are ignored when comparing elements of stringVector1";
  output String stringVector2[size(stringVector1, 1)] "stringVector1 sorted in alphabetical order";
end sort;

Generated at 2024-12-24T19:25:53Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos