# linegauge/slice

> Every export of linegauge/slice, with its signature and doc comment: slice, slice.

Source: https://linegauge.interlace.tools/docs/api/slice

<!-- Generated by scripts/api-reference.ts from the built dist/*.d.ts. Do not edit; run `npx tsx scripts/api-reference.ts`. -->

```ts
import slice from 'linegauge/slice';
import { slice } from 'linegauge/slice';
```

## Functions

### default

The default export, declared as `slice`.

`[start, end)` in display columns. A negative or reversed range is empty rather than an
error, matching `String.prototype.slice`'s temperament if not its units.

The walk's state is locals of this function rather than fields of an object, and that is
measured, not taste: a minifier renames a local and cannot touch a property name, and the
object form — `cut.pendingAt`, `cut.linkAt` and eight more, each spelled out on every use —
cost the bundled `linegauge/slice` more than this does (see `ceilings.json`).

```ts
function slice(string: string, start?: number, end?: number): string;
```

| Parameter | Type |
| :-- | :-- |
| `string` | `string` |
| `start` (optional) | `number` |
| `end` (optional) | `number` |

**Returns** `string`

### slice

`[start, end)` in display columns. A negative or reversed range is empty rather than an
error, matching `String.prototype.slice`'s temperament if not its units.

The walk's state is locals of this function rather than fields of an object, and that is
measured, not taste: a minifier renames a local and cannot touch a property name, and the
object form — `cut.pendingAt`, `cut.linkAt` and eight more, each spelled out on every use —
cost the bundled `linegauge/slice` more than this does (see `ceilings.json`).

```ts
function slice(string: string, start?: number, end?: number): string;
```

| Parameter | Type |
| :-- | :-- |
| `string` | `string` |
| `start` (optional) | `number` |
| `end` (optional) | `number` |

**Returns** `string`
