strip >>-strip-+----------------------+------------------------------->< +-(option-+--------+-)-+ +-,chars-+ 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 [option] s. (You need to specify only the first capitalized letter; all characters following it are ignored.)
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. 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" |
||||||