> For the complete documentation index, see [llms.txt](https://docs.cheddar.vihan.org/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cheddar.vihan.org/docs/literals/string.md).

# String

Strings are traditionally a sequence of characters, but you can think of them as "text". Cheddar's strings are like [Ruby](https://www.ruby-lang.org/en/)'s strings.

## Basic Syntax

Strings in Cheddar are delimited by **double quotes** or **single quotes**. Additionally, Cheddar supports **literal newlines** within Strings.

```javascript
"Hello, World!" // Both of these are
'Hello, World!' // exactly the same
```

Whichever quote you use is your choice and varies based on your personal preference. For the rest of this documentation, double quotes will be used.

## Using special characters

Cheddar is, again, like the C language in respect to escaping. You can use a **backslash** before a character to insert it's literal form rather than it to have a special meaning.

```javascript
"This is a double quote: \"."
'This is a single quote: \'.'
"This is a blackslash: \\"
```

## Using formatting

"String formatting" is a way to insert the **result of an expression** directly into a string. Using `#{ ... }` you can "format" a string.

```ruby
 "2+2=#{2+2}" # evaluates 2+2 and returns 4
 "2+2=4"      # Has the same value as the above
```

Backslashes also work to escape formatting:

```ruby
"2+2=\#{2+2}" # Does NOT evaluate 2+2 or the format
```

This evaluates to: `2+2=#{2+2}`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cheddar.vihan.org/docs/literals/string.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
