# Working with Strings
As with most languages, strings are a collection of 0 or more characters that represent text. This can include file names, file paths, names of columns,
and much more. Strings are so common that Nushell offers multiple string formats to match your use-case:
## String Formats at a Glance
| Format of string | Example | Escapes | Notes |
| ---------------------------------------------------- | ----------------------- | ------------------------- | ---------------------------------------------------------------------- |
| [Single-quoted string](#single-quoted-strings) | `'[^\n]+'` | None | Cannot contain single quotes within the string |
| [Double-quoted string](#double-quoted-strings) | `"The\nEnd"` | C-style backslash escapes | All literal backslashes must be escaped |
| [Raw strings](#raw-strings) | `r#'Raw string'#` | None | May include single quotes |
| [Bare word string](#bare-word-strings) | `ozymandias` | None | Can only contain "word" characters; Cannot be used in command position |
| [Backtick string](#backtick-quoted-strings) | <code>\`[^\n]+\`</code> | None | Bare string that can include whitespace. Cannot contain any backticks |
| [Single-quoted interpolation](#string-interpolation) | `$'Captain ($name)'` | None | Cannot contain any `'` or unmatched `()` |
| [Double-quoted interpolation](#string-interpolation) | `$"Captain ($name)"` | C-style backslash escapes | All literal backslashes and `()` must be escaped |
## Single-quoted Strings
The simplest string in Nushell is the single-quoted string. This string uses the `'` character to surround some text. Here's the text for hello world as a single-quoted string:
```nu
'hello world'
# => hello world
'The
end'
# => The
# => end
```
Single-quoted strings don't do anything to the text they're given, making them ideal for holding a wide range of text data.
## Double-quoted Strings
For more complex strings, Nushell also offers double-quoted strings. These strings use the `"` character to surround text. They also support the ability escape characters inside the text using the `\` character.
For example, we could write the text hello followed by a new line and then world, using escape characters and a double-quoted string:
```nu
"hello\nworld"
# => hello
# => world
```
Escape characters let you quickly add in a character that would otherwise be hard to type.
Nushell currently supports the following escape characters:
- `\"` - double-quote character
- `\'` - single-quote character
- `\\` - backslash
- `\/` - forward slash
- `\b` - backspace
- `\f` - formfeed
- `\r` - carriage return
- `\n` - newline (line feed)
- `\t` - tab
- `\u{X...}` - a single unicode character, where X... is 1-6 hex digits (0-9, A-F)
## Raw Strings
Raw strings behave the same as a single quoted strings, except that raw strings
may also contain single quotes. This is possible because raw strings are enclosed
by a starting `r#'` and a closing `'#`. This syntax should look familiar to users
of Rust.
```nu
r#'Raw strings can contain 'quoted' text.'#
# => Raw strings can contain 'quoted' text.
```
Additional `#` symbols can be added to the start and end of the raw string to enclose
one less than the same number of `#` symbols next to a `'` symbol in the string. This can
be used to nest raw strings:
```nu
r###'r##'This is an example of a raw string.'##'###
# => r##'This is an example of a raw string.'##
```
## Bare Word Strings
Like other shell languages (but unlike most other programming languages) strings consisting of a single 'word' can also be written without any quotes: