反轉(zhuǎn)字符串中的字符。
以下是reverse的基本使用語(yǔ)法:
(reverse str)
參數(shù)? 'str'是需要反轉(zhuǎn)的字符串。
返回值 ? 反轉(zhuǎn)后的字符串。
下面是reverse函數(shù)的示例:
(ns clojure.examples.hello (:gen-class)) (defn hello-world [] (println (reverse "Hello World"))) (hello-world)
以上示例將輸出以下結(jié)果:
(d l r o W o l l e H)
更多建議: