Skip to content

Function.replace

github-actions[bot] edited this page Nov 18, 2026 · 4 revisions

umt / replace

Function: replace()

replace(pattern, replacement): (value) => string

Defined in: Pipe/replace.ts:11

Creates a pipe operator that replaces matches of a pattern in a string

Parameters

pattern

string | RegExp

The string or regular expression to search for

replacement

string

The string that replaces each match

Returns

An operator that returns the replaced string

(value) => string

Example

pipe("a-b-c", replace("-", "+")); // "a+b-c"
pipe("a-b-c", replace(/-/g, "+")); // "a+b+c"

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally