Clojure-strings-trimr

提供:Dev Guides
移動先:案内検索

Clojure-文字列トリマー

文字列の右側から空白を削除します。

構文

構文は次のとおりです。

(trimr str)

パラメータ-「str」は入力文字列です。

戻り値-文字列の末尾から空白が削除された文字列。

Clojureのトリマーの例を次に示します。

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (clojure.string/trimr " White spaces ")))
(hello-world)

出力

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

White spaces

上記の出力では、文字列の先頭に空白が含まれます。