Clojure - 字符串 triml



从字符串左侧移除空白字符。

语法

以下是语法。

(triml str)

参数 − ‘str’ 是输入字符串。

返回值 − 从字符串开头移除空白字符后的字符串。

示例

以下是 Clojure 中 triml 的示例。

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

输出

以上程序产生以下输出。

White spaces

以上输出将在字符串末尾保留空格。

clojure_strings.htm
广告

© . All rights reserved.