tchmi_format_string

[ Function ]

function tchmi_format_string(formatString: string, …args: any[]): string;

Formats a string.

Placeholder syntax in format string: '{' to start placeholder, optional parameter index with | as separator, description and '}' to close placeholder.

Parameter

Name

Type

Description

formatString

string

The string to be formatted

…args

any[]

Placeholder array

Return value

Type

Description

string

Masked string.

tchmi_format_string 1:

Available from version 1.12

Sample - JavaScript

TcHmi.Log.debug(tchmi_format_string('{0} Test {1}', 'TwinCAT', 'HMI')); // 'TwinCAT Test HMI'