I would like to concatenate strings stored in a vector. For example if I have ["a" "b" "c"]
in the vector I would like to get as a result "abc"
.
Concatenation is the process of appending one string to the end of another string. You concatenate strings by using the + operator. For string literals and string constants, concatenation occurs at compile time; no run-time concatenation occurs. For string variables, concatenation occurs only at run time.
In Clojure, strings are text between a pair of " (double quote) characters. The ' (single quote) isn't used to express strings in Clojure. When we want to use double quotes within a string, they must be escaped by \ (backslash).
In formal language theory and computer programming, string concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball". In certain formalisations of concatenation theory, also called string theory, string concatenation is a primitive notion.
You can use apply
with the str
function:
(apply str ["a" "b" "c"])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With