• (butlast n s)
Returns s without the last n characters. Returns an empty string
if n is greater than the length of s.

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/string.clj:125 top

(defn ^String butlast
  "Returns s without the last n characters.  Returns an empty string
  if n is greater than the length of s."
  [n ^String s]
  (if (< (count s) n)
    ""
    (.substring s 0 (- (count s) n))))
Vars in clojure.contrib.string/butlast: - < butlast count defn
Used in 0 other vars

Comments top

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