文字列内の文字を反転します。
構文は次のとおりです。
(reverse str)
パラメータ-「str」は逆にする必要がある文字列です。
戻り値-逆の文字列。
以下は、Clojureのリバースの例です。
(ns clojure.examples.hello (:gen-class)) (defn hello-world [] (println (reverse "Hello World"))) (hello-world)
上記のプログラムは、次の出力を生成します。
(d l r o W o l l e H)