Skip to content
Branch: master
Find file History
Latest commit 0bb040e Mar 19, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
pad.ts Add strings/pad (#282) Mar 15, 2019
pad_test.ts
strings.ts
test.ts Test reorganization (#290) Mar 18, 2019

README.md

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..."
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.