Logo

Programming-Idioms

History of Idiom 41 > diff from v29 to v30

Edit summary for version 30 by furoscame:
New Clojure implementation by user [furoscame]

Version 29

2016-12-13, 20:53:44

Version 30

2017-11-05, 19:13:08

Idiom #41 Reverse a string

Create string t containing the same characters as string s, in reverse order.
Original string s must remain unaltered. Each character must be handled correctly regardless its number of bytes in memory.

Illustration

Idiom #41 Reverse a string

Create string t containing the same characters as string s, in reverse order.
Original string s must remain unaltered. Each character must be handled correctly regardless its number of bytes in memory.

Illustration
Imports
  (require [clojure.string :as s])
Code
(s/reverse "Hello World!")
Comments bubble
clojure.string refers to Java String and / invokes the method from there