effect-io-ai

Package: effect
Module: String

String.stripMarginWith

Strips a leading margin prefix from every line using the supplied margin character.

Example (Stripping custom margins)

import { String } from "effect"

const text = "  |hello\n  |world"
const result = String.stripMarginWith(text, "|")
console.log(result) // "hello\nworld"

Signature

declare const stripMarginWith: { (marginChar: string): (self: string) => string; (self: string, marginChar: string): string; }

Source

Since v2.0.0