lst_auto_rta.utils.string.split_string_around_template_var

lst_auto_rta.utils.string.split_string_around_template_var(string: str, var_identifier: str) List[str][source]

Return a list of substring in string, using var_identifier{…} as the delimiter, where … can be anything

Parameters:
  • string (str) – Input string to split.

  • var_identifier (str) – String used to indicate the start of a template variable. Eg “@” indicates that “@{t}” uses template variable t.

Returns:

List of substrings in string, splitted using the template variables found with var_identifier as delimiter.

Return type:

List[str]

Examples

>>> split_string_around_template_var("@{tel_id}{processIndex}_r0_dl1", "§")
["@{tel_id}_", "_r0_dl1"]