Clojure Strings upper-case

2018-12-21 13:57 更新

將字符串轉(zhuǎn)換為全大寫。

語法

以下是upper-case的基本使用語法:

(upper-case s)

參數(shù) ? where's'是要轉(zhuǎn)換的字符串。

返回值 ? 大寫字符串。

下面是upper-case函數(shù)的示例:

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

輸出

以上示例將輸出以下結(jié)果:

HELLOWORLD
HELLOWORLD
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號