无涯教程-Clojure - trim函数

63 阅读1分钟

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

trim - 语法

以下是语法。

(trim str)

参数      - str是输入字符串。

返回值  -  删除了空格的字符串。

trim - 示例

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

上面的程序产生以下输出。

White spaces

参考链接

www.learnfk.com/clojure/clo…