
- Clojure - Home
- Clojure - Overview
- Clojure - Environment
- Clojure - Basic Syntax
- Clojure - REPL
- Clojure - Data Types
- Clojure - Variables
- Clojure - Operators
- Clojure - Loops
- Clojure - Decision Making
- Clojure - Functions
- Clojure - Numbers
- Clojure - Recursion
- Clojure - File I/O
- Clojure - Strings
- Clojure - Lists
- Clojure - Sets
- Clojure - Vectors
- Clojure - Maps
- Clojure - Namespaces
- Clojure - Exception Handling
- Clojure - Sequences
- Clojure - Regular Expressions
- Clojure - Predicates
- Clojure - Destructuring
- Clojure - Date & Time
- Clojure - Atoms
- Clojure - Metadata
- Clojure - StructMaps
- Clojure - Agents
- Clojure - Watchers
- Clojure - Macros
- Clojure - Reference Values
- Clojure - Databases
- Clojure - Java Interface
- Clojure - Concurrent Programming
- Clojure - Applications
- Clojure - Automated Testing
- Clojure - Libraries
Clojure - str
The concatenation of strings can be done by the simple str function.
Syntax
Following is the syntax.
str stringvar1 stringvar2 stringvarn
Parameters − You can enter any number of string parameters which need to be concatenated.
Return Value − The return value is a string.
Example
Following is an example of the string concatenation in Clojure.
(ns clojure.examples.hello (:gen-class)) (defn hello-world [] (println (str "Hello" "World")) (println (str "Hello" "World" "Again"))) (hello-world)
Output
The above program will produce the following output.
HelloWorld HelloWorldAgain
clojure_strings.htm
Advertisements