Product SiteDocumentation Site

7.4.61. STRIP


>>-STRIP(string--+---------------------------+--)---------------><
                 +-,--+--------+--+--------+-+
                      +-option-+  +-,chars-+

Returns string with leading characters, trailing characters, or both, removed, based on the option you specify. The following are valid options. (Only the capitalized letter is needed; all characters following it are ignored.)
Both
removes both leading and trailing characters from string. This is the default.
Leading
removes leading characters from string.
Trailing
removes trailing characters from string.
The third argument, chars, specifies the set of characters to be removed, and the default is to remove all whitespace characters (spaces and horizontal tabs). If chars, is a null string, then no characters are removed. Otherwise, any occurrences of the characters in chars will be removed.
Here are some examples:

Example 7.83. Builtin function STRIP

STRIP("  ab c  ")        ->    "ab c"
STRIP("  ab c  ","L")    ->    "ab c  "
STRIP("  ab c  ","t")    ->    "  ab c"
STRIP("12.7000", ,0)     ->    "12.7"
STRIP("0012.700", ,0)    ->    "12.7"
STRIP("12.0000", "T", '.0') -> "12"