Clojure – Strings count

Clojure strings count

In this guide, we will discuss Clojure Strings Count. To find the number of characters in a string, you can use the count function.

Syntax

Following is the syntax.

(count stringvariable)

Parameters − ‘Stringvariable, is the string in which the number of characters need to be determined.

Return Value − The number of characters in the string.

Example

Following is an example of the string formatting in Clojure.

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

Output

The above program produces the following output.

5

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply