Created
September 6, 2015 12:25
-
-
Save uggds/2369c466937f6105b8f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn ellipsize [words] | |
(let [[w1 w2 w3] (str/split words #"\s+")] | |
(str/join " " [w1 w2 w3 "..."]))) | |
(ellipsize "The quick brown fox jumps over the lazy dog.") | |
-> "The quick brown ..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment