beautypg.com

Rtrim – AMT Datasouth PAL User Manual

Page 169

background image

163

_rtrim

_rtrim

Description

Eliminate undesired characters from right (trailing) edge of a string.

Usage

AnyStr SetStr

_rtrim

TrimmedStr

AnyStr

String. String possibly containing character to eliminate.

SetStr

String. Set of undesired characters. An empty string "()" instructs the interpreter
to trim whitespace characters.

Comments

PAL creates the new string TrimmedStr by copying the contents of AnyStr. As PAL copies the
characters from right to left, PAL compares each character to the list of characters contained in
SetStr. If PAL finds the character in SetStr it does not copy the character to TrimmedStr. As
soon as PAL finds a character from AnyStr which does not match a character in SetStr, PAL then
copies that character, and all remaining AnyStr characters to TrimmedStr.

Specifying an empty string "()" for SetStr instructs PAL to trim all whitespace characters from the
right edge of AnyStr. PAL treats all characters with a decimal value of 32 and below as whitespace
characters. This includes ASCII spaces, tabs, carriage returns, line feeds, as well as all other
standard ASCII non-printable control characters.