Skip to content

patternTrimEnd

patternTrimEnd(string, pattern?): string

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

Trims the specified pattern from the end of the string.

This method is like String.prototype.trimEnd(), but allows specifying a custom pattern. Use buildPatternTrimEnd instead when trimming the same pattern repeatedly.

string

The string to be trimmed.

string

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

string

The trimmed string.