Function: s-chop-prefix

s-chop-prefix is a byte-compiled function defined in s.el.

Signature

(s-chop-prefix PREFIX S)

Documentation

Remove PREFIX if it is at the start of S.

Source Code

;; Defined in ~/.emacs.d/elpa/s-20220902.1511/s.el
(defun s-chop-prefix (prefix s)
  "Remove PREFIX if it is at the start of S."
  (declare (pure t) (side-effect-free t))
  (let ((pos (length prefix)))
    (if (and (>= (length s) (length prefix))
             (string= prefix (substring s 0 pos)))
        (substring s pos)
      s)))