mkt.databases.utils.replace_string_using_dict

mkt.databases.utils.replace_string_using_dict(str_in: str, dict_in: dict[str, str]) str[source]

Replace any partial matches in a string using a dictionary of {string match : string replace}.

Parameters:
  • str_in (str) – Input string to replace partial matches

  • dict_in (dict[str, str]) – Dictionary of {string match : string replace}

Returns:

str_out – String with any partial matches replaced

Return type:

str