Hyperlinkv0.8.0-beta.28

String

String.padStartconsteffect/String.ts:789
(maxLength: number, fillString?: string): (self: string) => string

Pads the string from the start with a given fill string to a specified length.

Example (Padding strings at the start)

import { pipe, String } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(pipe("a", String.padStart(5)), "    a")
assert.deepStrictEqual(pipe("a", String.padStart(5, "_")), "____a")
transforming
Source effect/String.ts:7892 lines
export const padStart = (maxLength: number, fillString?: string) => (self: string): string =>
  self.padStart(maxLength, fillString)