- Similar to strim but more performant.
- BOTH, LEFT, RIGHT, DEFAULT are strings and may be "".
- Chars in BOTH are trimmed from left and right ends of STR.
- Chars in LEFT/RIGHT are trimmed from the respective end of STR.
- By default, chars in BOTH/LEFT/RIGHT are in addition to "\n", "\t" and " ".
- Chars in DEFAULT replace the default trim chars.
(import nutils)
(define str "\t\t---... A string. ---+++\n\n")
(trim-string str) (trim-string str ".+-" (trim-string str "+-" "" ".") (trim-string str "" "-." "-+") (define str2 "---...Another string.--++")
(trim-string str2 "" "" "" "-.+")