$DEPAD

From m204wiki
Jump to navigation Jump to search

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