Function: s-ends-with?

s-ends-with? is a byte-compiled function defined in s.el.

Signature

(s-ends-with? SUFFIX S &optional IGNORE-CASE)

Documentation

Does S end with SUFFIX?

If IGNORE-CASE is non-nil, the comparison is done without paying attention to case differences.

Alias: s-suffix?

Aliases

s-suffix-p s-suffix? s-ends-with-p

Source Code

;; Defined in ~/.emacs.d/elpa/s-20220902.1511/s.el
(defun s-ends-with? (suffix s &optional ignore-case)
  "Does S end with SUFFIX?

If IGNORE-CASE is non-nil, the comparison is done without paying
attention to case differences.

Alias: `s-suffix?'"
  (declare (pure t) (side-effect-free t))
  (let ((start-pos (- (length s) (length suffix))))
    (and (>= start-pos 0)
         (eq t (compare-strings suffix nil nil
                                s start-pos nil ignore-case)))))