Created
March 11, 2020 09:27
-
-
Save tychobrailleur/e183cd3accfe5f9aa2bb1bf0fa57cfd8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(require 'clojure.string) | |
(defn remove-last-vowel [word] | |
(-> word | |
clojure.string/reverse | |
(clojure.string/replace-first #"[aeiouy]" "") | |
clojure.string/reverse)) | |
(defn remove-last-vowels [sentence] | |
(->> (clojure.string/split sentence #" ") | |
(map remove-last-vowel) | |
(clojure.string/join " "))) | |
(println (remove-last-vowels "Hi, there!")) | |
(println (remove-last-vowels "This is not a test.")) | |
(println (remove-last-vowels "Hippopotamus")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment