StringTrimLeft / StringTrimRight

Removes a number of characters from the left or right-hand side of a string.

Deprecated: These commands are not recommended for use in new scripts. Use the SubStr function instead.

StringTrimLeft, OutputVar, InputVar, Count
StringTrimRight, OutputVar, InputVar, Count

Parameters

OutputVar

The name of the variable in which to store the shortened version of InputVar.

InputVar

The name of the variable whose contents will be read from. Do not enclose the name in percent signs unless you want the contents of the variable to be used as the name.

Count

The number of characters to remove, which can be an expression. If Count is less than or equal to zero, OutputVar will be set equal to the entirety of InputVar. If Count exceeds the length of InputVar, OutputVar will be made empty (blank).

Remarks

For this and all other commands, OutputVar is allowed to be the same variable as an InputVar.

SubStr(), StringMid, StringLeft, StringRight, IfInString, StringGetPos, StringLen, StringLower, StringUpper, StringReplace

Examples

Removes 5 characters from the left side and stores the string "is a test." in OutputVar.

String := "This is a test."
StringTrimLeft, OutputVar, String, 5

Removes 6 characters from the right side and stores the string "This is a" in OutputVar.

String := "This is a test."
StringTrimRight, OutputVar, String, 6