Clojure – Strings reverse

Clojure strings reverse

In this guide, we will discuss Clojure Strings reverse. Reverses the characters in a string.

Syntax

Following is the syntax.

(reverse str)

Parameters βˆ’ β€˜str’ is the string which needs to be reversed.

Return Value βˆ’ The reversed string.

Example

Following is an example of reverse in Clojure.

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (reverse "Hello World")))
(hello-world)

Output

The above program produces the following output.

(d l r o W   o l l e H)                                                        

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply