In this guide, we will discuss Clojure Strings trim. Removes whitespace from both ends of the string.
Syntax
Following is the syntax.
(trim str)
Parameters β βstrβ is the input string.
Return Value β The string which has the whitespaces removed.
Example
Following is an example of trim in Clojure.
(ns clojure.examples.hello (:gen-class)) (defn hello-world [] (println (clojure.string/trim " White spaces "))) (hello-world)
Output
The above program produces the following output.
White spaces
Next Topic : Click Here
Pingback: Clojure - Strings replace | Adglob Infosystem Pvt Ltd
Pingback: Clojure - Strings | Adglob Infosystem Pvt Ltd