Function: org-unbracket-string
org-unbracket-string is a byte-compiled function defined in
org-macs.el.
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 ~/.emacs.d/elpa/org-9.8.2/org-macs.el
(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)))