当前位置: 首页 > 文档资料 > Clojure 中文教程 >

upper-case

优质
小牛编辑
119浏览
2023-12-01

将字符串转换为全大写。

语法 (Syntax)

以下是语法。

(upper-case s)

Parameters - 其中's'是要转换的字符串。

Return Value - 大写字符串。

例子 (Example)

以下是Clojure中的大写示例。

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

输出 (Output)

上述程序产生以下输出。

HELLOWORLD
HELLOWORLD