Topology > I/O Devices > Import Variable Tags from an External Data Source > Built-in Functions
Built-In Functions

There are three built-in functions that can be used to manipulate strings in the XML template. The syntax to call a built-in function as follows:

{<FunctionName>(<arg1>, <arg2>,...)}

The three built-in functions are:

SubString(string, 'start', 'count')

This function extracts a substring from the given source string starting at character start and ending after count characters.

<string name="AddrWord">{SubString('{tagprefix}','3','2')}</string> 

Split(string, delimiter)

This function splits the source string into parts separated by the delimiter and stores them in a zero based string array. For example:

<array name="tagid">
{split('VJA;VJT', ';')}
</array>

produces tagid[0] = VJA, tagid[1] = VJT.

ToProperty(string, separator, delimiter)

This function splits the source string parts separated by the delimiter, and then further into key value pairs separated by the separator. For example:

<array name="taginfo">
{ToProperty('VJA=Alarm;VJT=Trend', '=', ';')}
</array>

produces taginfo[VJA] = Alarm, taginfo[VJT] = Trend.

Published June 2018