Skip to content

Commit

Permalink
moved a few string utilities to metatiliities-base
Browse files Browse the repository at this point in the history
darcs-hash:20080527012118-3cc5d-a098e2ed38e915c2dc0ddba3e9476ef39803c98f.gz
  • Loading branch information
Gary King committed May 27, 2008
1 parent 1c585ab commit 6b6ab6b
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions dev/utilities/strings.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,6 @@
;;; A few functions cribbed from Wiblur. Feel free to improve.
;;;

(defun string-starts-with (string prefix &key ignore-case-p)
(declare (type string string prefix))
(let ((prelen (length prefix)))
(when (<= prelen (length string))
(if ignore-case-p
(string-equal string prefix :end1 prelen)
(string= string prefix :end1 prelen)))))

;; not cribbed from Wilbur --cas
(defun string-ends-with (string suffix &key ignore-case-p)
(declare (type string string suffix))
(let ((suflen (length suffix))
(strlen (length string)))
(when (< suflen (length string))
(if ignore-case-p
(string-equal string suffix :start1 (- strlen suflen))
(string= string suffix :start1 (- strlen suflen))))))

(defun substring (string start &optional end downcasep)
(declare (type string string) (type fixnum start) (optimize (speed 3) (safety 0)))
(let* ((end (or end (length string)))
Expand Down

0 comments on commit 6b6ab6b

Please sign in to comment.