1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-23 15:16:54 -05:00
denoland-deno/strings
2019-05-27 02:58:31 +03:00
..
decode.ts rename strings/strings.ts to strings/mod.ts (denoland/deno_std#449) 2019-05-27 02:58:31 +03:00
encode.ts rename strings/strings.ts to strings/mod.ts (denoland/deno_std#449) 2019-05-27 02:58:31 +03:00
mod.ts rename strings/strings.ts to strings/mod.ts (denoland/deno_std#449) 2019-05-27 02:58:31 +03:00
pad.ts toml: add Stringify feature (denoland/deno_std#319) 2019-04-05 00:23:05 -04:00
pad_test.ts Eslint fixes (denoland/deno_std#356) 2019-04-24 07:41:22 -04:00
README.md Documentation clean up (denoland/deno_std#288) 2019-03-18 11:08:01 -04:00
test.ts Test reorganization (denoland/deno_std#290) 2019-03-18 12:49:54 -04:00

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:

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..."