TrimToLength

function TrimToLength(value: string | null, trimToLength: number | string | null): string | null

The function TrimToLength shortens a string to a specified number of characters from left or right.

Parameter

Name

Type

Description

value

string

String to be shortened.

trimToLength

number

Number of characters to which the string is to be shortened. Positive values shorten the string from the left, negative values from the right.

Return value

Type

Description

string | null

The truncated string or null if anything other than string was passed.

NuGet package: Beckhoff.TwinCAT.HMI.Functions

TrimToLength 1:

NuGet packages are available from version 1.12.

TrimToLength 2:

Available from 1.8