(maxLength: number, fillString?: string): (self: string) => stringPads the string from the end with a given fill string to a specified length.
Example (Padding strings at the end)
import { pipe, String } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(pipe("a", String.padEnd(5)), "a ")
assert.deepStrictEqual(pipe("a", String.padEnd(5, "_")), "a____")transforming
Source effect/String.ts:7702 lines
export const const padEnd: (
maxLength: number,
fillString?: string
) => (self: string) => string
Pads the string from the end with a given fill string to a specified length.
Example (Padding strings at the end)
import { pipe, String } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(pipe("a", String.padEnd(5)), "a ")
assert.deepStrictEqual(pipe("a", String.padEnd(5, "_")), "a____")
padEnd = (maxLength: numbermaxLength: number, fillString: string | undefinedfillString?: string) => (self: stringself: string): string =>
self: stringself.String.padEnd(maxLength: number, fillString?: string): stringPads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
The padding is applied from the end (right) of the current string.
padEnd(maxLength: numbermaxLength, fillString: string | undefinedfillString)