$DEPAD

From m204wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The $DEPAD function removes the designated characters from both sides of a specific string.

Syntax

$DEPAD(%string,%remove)

The %remove characters are removed from %string.

Examples:

if %STRING = '___ABC___' then PRINT $DEPAD(%STRING,'_')

results in ABC

if %STRING = 'XYZABCXYZ' then PRINT $DEPAD(%STRING,'XYZ')

also results in ABC

IF %STRING = '+A+B+C+' THEN PRINT $DEPAD(%STRING,'+')

results in A+B+C