replace
Replaces occurrences of strings in a given string based on a replacements map.
Import:
import { replace } from 'obsidian-dev-utils/string';Signature:
function replace(str: string, replacementsMap: Record<string, string>): stringParameters:
| Parameter | Type | Description |
|---|---|---|
str | string | The string to perform replacements on. |
replacementsMap | Record<string, string> | An object mapping strings to their replacement values. |
Returns: string — The modified string with replacements applied.