Quoted, Interpolated and Escaped Strings in Julia
Last Updated :
15 Jul, 2025
String in Julia is a finite sequence of characters. The string can consist of numerals, common punctual symbols, a single word, a group of words, or a multi-line paragraph. Julia allows us to use and manipulate the data in the strings in many ways. Julia also offers a few high-level features for the strings. Some of these features are further discussed in this article.
Quoted Strings
Julia offers us to create strings using double-quotes (" "), and triple-quotes (''' ''') as well. Double-quoted strings are treated normally but triple-quoted strings have some extra features available to them.
Double-quoted strings
These types of strings are treated normally in Julia like in any other language. Operations like concatenation and interpolation are allowed in double-quoted strings.
Julia
# create three double-quoted strings
s1 = "Geeks"
s2 = "for"
s3 = "geeks"
# concatenating strings
s = "s1, s2, s3"
Triple-quoted strings
These types of strings have special behaviors in Julia which are helpful to create long blocks of text. Triple-quoted strings are useful to use in codes that are indented because they recognize new lines.
Julia
# create a triple-quoted string
str = """
Geeks,
for,
geeks
"""
A new line after the first triple quotes is not considered:
Julia
# create string literal
"""
Geeks"""
# create string literal with new line
"""
Geeks"""

Interpolation of strings
Doing concatenation on strings sometimes can get inconvenient, to tackle this Julia offers interpolation into string literals using $.
Julia
# create three strings
s1 = "Geeks"
s2 = "for"
s3 = "geeks"
# interpolation using $
"$s1 $s2 $s3"
In Julia, the interpolation operation can be done in a part of a string literal using parentheses:
Julia
# interpolation using parentheses
"2 + 4 = $(2 + 4)"

Escaped strings
To include any character in the string, we have to place a backslash (\) before it:
Julia
# placing $ in string
print("I want 1000\$ in my bank account")
We can also escape double-quotes using backslash:
Julia
# escaping double quotes
str = "This is \"Geeksforgeeks\"."
print(str)
Similar Reads
Perl | Quoted, Interpolated and Escaped Strings A string in Perl is a scalar variable and start with a ($) sign and it can contain alphabets, numbers, special characters. The string can consist of a single word, a group of words or a multi-line paragraph. The String is defined by the user within a single quote (â) or double quote (â). Quoted Stri
4 min read
String Interpolation in JavaScript These are the following ways to interpolate the given strings:1. Template Literals (ES6)Template literals are the most modern and preferred method for string interpolation in JavaScript. They use backticks (`` ` ``) and ${} syntax to embed expressions.JavaScriptconst n = "Alice"; const res = `Hello,
2 min read
What is String interpolation in CoffeeScript ? CoffeeScript is a lightweight language that compiles into JavaScript. As compared to JavaScript, it provides simple and easy-to-learn syntax avoiding the complex syntax of JavaScript. CoffeeScript is influenced by languages such as JavaScript, YAML, Ruby, Python and has also influenced languages tha
3 min read
String concatenation in Julia String concatenation in Julia is a way of appending two or more strings into a single string whether it is character by character or using some special characters end to end. There are many ways to perform string concatenation. Example:Â Input: str1 = 'Geeks' str2 = 'for' str3 = 'Geeks' Output: 'Gee
2 min read
String to Number Conversion in Julia Julia is a flexible, dynamic, and high-level programming language that can be used to write any application. Also, many of its features can be used for numerical analysis and computational science. Julia is being widely used in machine learning, visualization, and data science. Julia allows type con
3 min read
How to Escape single and double quotes in a string in Ruby? To handle strings containing single or double quotes in Ruby is not simple since putting these characters themselves within the string may also present difficulties. Your codes can give a syntax error or work in a way unintended just because of unescaped quotes. Luckily, Ruby has different ways to e
2 min read