# String Methods — JavaScript Fundamentals: From Syntax to Async

Source: https://www.skillbyai.com/en/javascript/js-string-methods

> Clean, search, split and slice text with JavaScript's non-mutating string methods.

## Everyday methods

Case, whitespace and search helpers cover most everyday text cleanup.

```js
const s = "  Hello JS  ";
console.log(s.trim());
console.log(s.toUpperCase());
console.log(s.trim().includes("JS"));
console.log(s.replace("JS", "World"));
```

## Slicing & splitting

`split()` turns text into an array; `slice()` extracts a substring by position.

```js
const csv = "apple,banana,cherry";
console.log(csv.split(","));        // ['apple', 'banana', 'cherry']
console.log("Hello".slice(1, 4));   // "ell"
```

## Strings are immutable

Every string method returns a **new** string — the original value never changes.
