openmrs-esm-core

O3 Framework / interpolateString

Function: interpolateString()

interpolateString(template, params): string

Defined in: packages/framework/esm-navigation/src/navigation/interpolate-string.ts:62

Interpolates values of params into the template string.

Example usage:

interpolateString("test ${one} ${two} 3", {
   one: "1",
   two: "2",
}); // will return "test 1 2 3"
interpolateString("test ok", { one: "1", two: "2" }) // will return "test ok"

Parameters

template

string

With optional params wrapped in ${ }

params

Values to interpolate into the string template

Returns

string

The template string with all parameter placeholders replaced by their values.