replaceMap

Replaces each key in replaceMap with it's value.

T
replaceMap
(
T
TKey
TValue
)
(
,
TKey[TValue] replaceMap
)
if (
isSomeString!T &&
isSomeString!TKey
&&
isSomeString!TValue
)

Parameters

base
Type: T

The string to replace on.

replaceMap
Type: TKey[TValue]

The map to use to replace things.

Return Value

Type: T

The updated string.

Examples

Example

assert( "$val1 $val2 val3".replaceMap( [ "$val1": "test1", "$val2": "test2", "$val3": "test3" ] ) == "test1 test2 val3" );

Meta