# Strings

In JavaScript, a string is a sequence of characters enclosed in quotes. You can use single or double quotes to create a string, as long as you use the same type of quotes to enclose the string.

Here are some examples of strings in JavaScript:

```javascript
const name = 'John';
const message = "Welcome to my adventure game!";
const error = 'It\'s not possible to go that way';
```

You can also use string concatenation to combine strings together. For example:

```javascript
const greeting = 'Hello ' + name + ', ' + message;
```

This would create a new string with the value `"Hello John, Welcome to my adventure game!"`

There are many methods available for working with strings in JavaScript. Here are a few examples:

* `length`: Returns the length of a string (i.e. the number of characters)
* `toUpperCase()`: Returns a new string with all characters in uppercase
* `toLowerCase()`: Returns a new string with all characters in lowercase
* `substring(start, end)`: Returns a new string containing the characters from a string between the specified start and end indices


---

# Agent Instructions: 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://demirels-organization.gitbook.io/javascript-tutorial/strings.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.
