Clojure-str

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

Clojure-str

文字列の連結は、単純なstr関数によって実行できます。

構文

構文は次のとおりです。

str stringvar1 stringvar2 stringvarn

パラメータ-連結する必要がある文字列パラメータをいくつでも入力できます。

戻り値-戻り値は文字列です。

以下は、Clojureの文字列連結の例です。

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

出力

上記のプログラムは、次の出力を生成します。

HelloWorld
HelloWorldAgain