10 lines
256 B
Clojure
10 lines
256 B
Clojure
(let [s "I am a string"]
|
|
;; match
|
|
(when (re-find #"string$" s)
|
|
(println "Ends with 'string'."))
|
|
(when-not (re-find #"^You" s)
|
|
(println "Does not start with 'You'."))
|
|
|
|
;; substitute
|
|
(println (clojure.string/replace s " a " " another "))
|
|
)
|