Handlebar Helper Function: Replace

Replaces occurrences of a search string with a replacement string in a case-sensitive manner. This ensures precise string matching and replacement.

ParameterTypeDescription
subjectstringRequired. The string to search and replace in. Non-string inputs are converted to strings through language-level type coercion.
searchstringRequired. The string to search for (case-sensitive). Non-string inputs are converted to strings through language-level type coercion.
replacementstringRequired. The string to replace matches with. Non-string inputs are converted to strings through language-level type coercion.
culturestringBCP 47 locale code for culture-specific case comparison. Supports both hyphen (en-US) and underscore (en_US) formats. Defaults to current system culture if not specified.

The function returns the input string with all occurrences of the search string replaced by the replacement string. The search is performed case-sensitively for precise matching. If the search string is empty, no replacement occurs. If the input is null, it returns an empty string.