string.slice()
'some_string'.slice(start, end) → string
Returns a substring between two indices.
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| start | number | yes | — | Start index (inclusive). |
| end | number | yes | — | End index (exclusive). |
Returns
string
The substring.
Example
'abcdef'.slice(1,3) === 'bc';