replaceMultipleCharactersForList

Modified on Fri, 18 Aug 2023

Description

Replace multiple characters in a list of strings according to a given mapping

Syntax

replaceMultipleCharactersForList(array, replacements)

Parameters

Input ParameterTypeDescription
arrayArrayThe list of input strings to perform replacements on
replacementsobjectAn object containing characters to replace and their corresponding replacements

Return value

Type
Array<any>

Sample

ExampleResultDescription
replaceMultipleCharactersForList(['abcd', '$12.34'], { 'a': '10', 'c': '20', '$': '', '.' : ',' })['10b20d', '12,34']The list of input strings with specified characters replaced

To view all the List functions, click here.

See Also