Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Clojure Strings replace

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (clojure.string/replace "The tutorial is about Groovy" #"Groovy"
      "Clojure")))
(hello-world)

Clojure Strings reverse

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (reverse "Hello World")))
(hello-world)

Clojure Strings split-lines

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (clojure.string/split-lines "Hello\nWorld")))
(hello-world)

Clojure Strings split

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (clojure.string/split "Hello World" #" ")))
(hello-world)

Clojure Strings join

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (clojure.string/join ", " [1 2 3])))
(hello-world)

Clojure Strings upper-case

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

Clojure Strings lower-case

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

Clojure Strings compare

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (compare "Hello" "hello"))
   (println (compare "Hello" "Hello")))
(hello-world)

Clojure Strings subs

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (subs "HelloWorld" 2 5))
   (println (subs "HelloWorld" 5 7)))
(hello-world)

Clojure Strings count

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (count "Hello")))
(hello-world)

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.