Function: org-unbracket-string
org-unbracket-string is a byte-compiled function defined in
org-macs.el.gz.
Signature
(org-unbracket-string PRE POST STRING)
Documentation
Remove PRE/POST from the beginning/end of STRING.
Both PRE and POST must be pre-/suffixes of STRING, or neither is removed. Return the new string. If STRING is nil, return nil.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-macs.el.gz
(defun org-unbracket-string (pre post string)
"Remove PRE/POST from the beginning/end of STRING.
Both PRE and POST must be pre-/suffixes of STRING, or neither is
removed. Return the new string. If STRING is nil, return nil."
(declare (indent 2))
(and string
(if (and (string-prefix-p pre string)
(string-suffix-p post string))
(substring string (length pre)
(and (not (string-equal "" post)) (- (length post))))
string)))