blob: 7621248bb7adfeec4da25868ce94af847731863a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# Strings
This module provides a few basic utilities to manipulate strings.
## Usage
### pad
Input string is processed to output a string with a minimal length. If the
parameter `strict` is set to true, the output string length is equal to the
`strLen` parameter.
Basic usage:
```ts
import { pad } from "https://deno.land/std/strings/pad.ts";
pad("deno", 6, { char: "*", side: "left" }); // output : "**deno"
pad("deno", 6, { char: "*", side: "right" }); // output : "deno**"
pad("denosorusrex", 6, {
char: "*",
side: "left",
strict: true,
strictSide: "right",
strictChar: "..."
}); // output : "den..."
```
|