從字符串的右側刪除空格。
以下是trimr的基本使用語法:
(trimr str)
參數(shù)? 'str'是輸入字符串。
返回值 ? 從字符串末尾刪除空格的字符串。
下面是trimr函數(shù)的示例:
(ns clojure.examples.hello (:gen-class)) (defn hello-world [] (println (clojure.string/trimr " White spaces "))) (hello-world)
以上示例將輸出以下結果:
White spaces
上面的輸出在字符串的開頭有空格。
更多建議: