Product Site

5.1.7.90. strip

Returns a copy of the receiving string with leading characters, trailing characters, or both, removed, based on the option you specify. The following are valid options. (You need to specify only the first capitalized letter; all characters following it are ignored.)
Both

Removes both leading and trailing characters. This is the default.
Leading

Removes leading characters.
Trailing

Removes trailing characters.

The 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.
Example 5.125. String class — strip method
"  ab c  "~strip         -->    "ab c"
"  ab c  "~strip("L")    -->    "ab c  "
"  ab c  "~strip("t")    -->    "  ab c"
"12.7000"~strip(,0)      -->    "12.7"
"0012.700"~strip(,0)     -->    "12.7"
"0012.000"~strip(,".0")  -->    "12"