Anonymous user
Split a character string based on change of character: Difference between revisions
Split a character string based on change of character (view source)
Revision as of 19:36, 12 April 2017
, 7 years agoAdds Clojure solution
Walterpachl (talk | contribs) m (→{{header|ooRexx}}: allow for comma as argument) |
(Adds Clojure solution) |
||
Line 242:
=={{header|Clojure}}==
<lang clojure>(defn print-cchanges [s]
(println (clojure.string/join ", " (map first (re-seq #"(.)\1*" s)))))
(print-cchanges "gHHH5YY++///\\")
</lang>
{{out}}
<pre>g, HHH, 5, YY, ++, ///, \</pre>
=={{header|Common Lisp}}==
|