> For the complete documentation index, see [llms.txt](https://demirels-organization.gitbook.io/javascript-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://demirels-organization.gitbook.io/javascript-tutorial/strings.md).

# 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
