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