Skip to main content
Module

x/fun/mod.ts>string.replace

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

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