Skip to main content
Module

x/fun/string.ts>replace

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function replace
import { replace } from "https://deno.land/x/fun@v2.0.0/string.ts";

Create a function that replaces all values in a string according to a RegExp and a replacement value.

Examples

Example 1

import { replace } from "./string.ts";

const cap = replace("hello", "Hello");

const result = cap("hello World"); // "Hello World"

Parameters

searchValue: string | RegExp
replaceValue: string