当前位置: 首页 > 文档资料 > Clojure 中文教程 >

triml

优质
小牛编辑
119浏览
2023-12-01

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

语法 (Syntax)

以下是语法。

(triml str)

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

Return Value - 从字符串开头删除空格的字符串。

例子 (Example)

以下是Clojure中修剪的示例。

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

输出 (Output)

上述程序产生以下输出。

White spaces

上面的输出将在字符串的末尾有空格。