str_to_list

Contents

str_to_list#

str_to_list(list_str: str | list, additional_separator: str = '', case: str | None = None) list[source]#

Convert str to list with ,, ;, :code:` ` separators.

Parameters:
  • list_str (Union[str, list]) – List as a string

  • additional_separator (str) – Additional separators. Base ones are ,, ;, (space).

  • case (str) – {none, ‘lower’, ‘upper’}

Returns:

A list from split string

Return type:

list

Example

>>> str_to_list("A, B; C D")
["A", "B", "C", "D"]