functionsubstituteChar

A single character of a string str is substituted by a given character c at index i.

Extends from Modelica.Icons.Function (Icon for functions).

Information

Syntax

str2 = substituteChar(str, i, c);

Description

A single character of a string str is substituted by a given character c at index i.

Example

  str2 := substituteChar("Hello", 2, "a");
               -> str2 = "Hallo"
               
  str2 := substituteChar("Hello", 3, "");
               -> str2 = "Helo"

Inputs

TypeNameDefaultDescription
Stringstrstring to be considered
Integeriindex of character inside str to be substituted
Stringccharacter that replaces the character in str at index i

Outputs

TypeNameDefaultDescription
Stringstr2result string