Returns s without the last n characters. Returns an empty string
if n is greater than the length of s.
(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))))
Comments top
No comments for butlast. Log in to add a comment.