• (ltrim s c)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/pprint/utilities.clj:75 top

(defn ltrim [s c]
  "Trim all instances of c from the beginning of sequence s"
  (let [len (count s)]
    (if (and (pos? len) (= (nth s 0) c))
      (loop [n 0]
        (if (or (= n len) (not (= (nth s n) c)))
          (subs s n)
          (recur (inc n))))
Vars in clojure.contrib.pprint.utilities/ltrim: = and defn inc let loop not nth or pos? subs
Used in 0 other vars

Comments top

No comments for ltrim. Log in to add a comment.