文字列の両端から空白を削除します。
構文は次のとおりです。
(trim str)
パラメータ-「str」は入力文字列です。
戻り値-空白が削除された文字列。
以下はClojureのトリムの例です。
(ns clojure.examples.hello (:gen-class)) (defn hello-world [] (println (clojure.string/trim " White spaces "))) (hello-world)
上記のプログラムは、次の出力を生成します。
White spaces