Clojure – Strings triml

Clojure strings triml

In this guide, we will discuss Clojure Strings triml. Removes whitespace from the left hand side of the string.

Syntax

Following is the syntax.

(triml str)

Parameters βˆ’ β€˜str’ is the input string.

Return Value βˆ’ The string which has the whitespaces removed from the beginning of the string.

Example

Following is an example of triml in Clojure.

(ns clojure.examples.hello
   (:gen-class))
(defn hello-world []
   (println (clojure.string/triml " White spaces ")))
(hello-world)

Output

The above program produces the following output.

White spaces

The above output will have the white spaces at the end of the string.

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply