.Modelica.Utilities.Strings.Advanced.scanIdentifier

Information

Syntax

(nextIndex, identifier) = scanIdentifier(string, startIndex=1);

Description

Starts scanning of "string" at position "startIndex". First skips white space and scans afterwards a Modelica identifier, i.e., a sequence of characters starting with a letter ("a".."z" or "A".."Z") followed by letters, digits or underscores ("_").

If successful, the function returns nextIndex = index of character directly after the found identifier, as well as the identifier as string in the second output argument.

If not successful, on return nextIndex = startIndex and the second output argument is an empty string.

See also

Strings.Advanced.

Interface

function scanIdentifier
  extends Modelica.Icons.Function;
  input String string;
  input Integer startIndex(min = 1) = 1 "Index where scanning starts";
  output Integer nextIndex "Index after the found token (success=true) or index at which scanning failed (success=false)";
  output String identifier "Value of identifier token";
end scanIdentifier;

Generated at 2020-06-05T07:38:22Z by OpenModelica 1.16.0~dev-420-gc007a39