目录

trim

从字符串的两端删除空格。

语法 (Syntax)

以下是语法。

(trim str)

Parameters - 'str'是输入字符串。

Return Value - 删除了空格的字符串。

例子 (Example)

以下是Clojure中的修剪示例。

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

输出 (Output)

上述程序产生以下输出。

White spaces
↑回到顶部↑
WIKI教程 @2018