Clojure - 字串大寫



將字串轉換為全大寫。

語法

以下是語法。

(upper-case s)

引數 - 其中“s”是要轉換的字串。

返回值 - 大寫的字串。

示例

以下是 Clojure 中大寫的示例。

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

輸出

以上程式產生以下輸出。

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