Truncate(
     string:string,
     int:length,
     [int:type]
)
string

Arguments

string

Input string to truncate.

length

Number of characters to truncate to.

type

Optional. Truncation type. Options are:

0truncate on the right
1truncate on the left
2truncate in the middle

Return value

The truncated string.

Description

Truncates the string to the specified number of characters.

If the truncation type isn't specified, the default is 2 if the input value is a path - otherwise the default is 0.

If the input value is a path and middle truncation is selected, the function takes path separators into account correctly.

Example:

Output( Truncate("C:\Program Files\GPSoftware\Directory Opus\dopus.exe" as path, 32, 2) );
--> C:\Program Files\GP...\dopus.exe