Clojure-strings-reverse

提供:Dev Guides
2020年6月22日 (月) 22:43時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

Clojure-文字列の逆

文字列内の文字を反転します。

構文

構文は次のとおりです。

(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)