无涯教程-Clojure - trimr函数

66 阅读1分钟

从字符串的右侧删除空格。

trimr - 语法

以下是语法。

(trimr str)

参数      - str是输入字符串。

返回值  -  从字符串末尾除去空格的字符串。

trimr - 示例

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

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

White spaces

上面的输出在字符串的开头将有空格。

参考链接

www.learnfk.com/clojure/clo…