Skip to content

buildPatternTrimStart

buildPatternTrimStart(pattern?): (string) => string

Defined in: packages/core/src/pattern/pattern-trim.ts:31

Creates a function that trims the specified pattern from the start of a string. Prefer this over patternTrimStart when trimming the same pattern repeatedly, as the regex is compiled once.

string

The pattern to trim. If not provided, whitespace and line terminators are trimmed.

A function that trims the pattern from the start of a string.

(string) => string