Take first n characters from s, up to the length of s.
Note the argument order is the opposite of clojure.core/take; this
is to keep the string as the first argument for use with ->
(defn ^String take
"Take first n characters from s, up to the length of s.
Note the argument order is the opposite of clojure.core/take; this
is to keep the string as the first argument for use with ->"
[^String s n]
(if (< (count s) n)
s
(.substring s 0 n)))
Comments top
No comments for take. Log in to add a comment.