# The String split() method

> Learn how the JavaScript split() method breaks a string into an array of tokens every time it finds a separator pattern, with the case-sensitive match removed.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2019-03-01 | Topics: [JavaScript](https://flaviocopes.com/tags/js/) | Canonical: https://flaviocopes.com/javascript-string-split/

`split()` truncates a string when it finds a pattern (case sensitive), and returns an array with the tokens:

```js
const phrase = 'I love my dog! Dogs are great'
const tokens = phrase.split('dog')

tokens //["I love my ", "! Dogs are great"]
```
