Split a string by multiple markers
(content: str, markers: list[str])
| 178 | |
| 179 | |
| 180 | def split_string_by_multi_markers(content: str, markers: list[str]) -> list[str]: |
| 181 | """Split a string by multiple markers""" |
| 182 | if not markers: |
| 183 | return [content] |
| 184 | results = re.split("|".join(re.escape(marker) for marker in markers), content) |
| 185 | return [r.strip() for r in results if r.strip()] |
| 186 | |
| 187 | |
| 188 | def enclose_string_with_quotes(content: Any) -> str: |
nothing calls this directly
no outgoing calls
no test coverage detected