Clojure - 字串小寫



將字串全部轉換為小寫。

語法

語法如下:

(lower-case s)

引數 − “s”是待轉換的字串。

返回值 − 小寫的字串。

示例

以下是 Clojure 中小寫的示例。

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (clojure.string/lower-case "HelloWorld"))
   (println (clojure.string/lower-case "HELLOWORLD")))
(hello-world)

輸出

以上程式產生以下輸出。

helloworld
helloworld
clojure_strings.htm
廣告
© . All rights reserved.