condense_numbered_strings#
- condense_numbered_strings(inputs: Sequence[str] | None) str[source]#
Condense a list of numbered strings into a compact string representation.
This function takes a sequence of strings with a common prefix followed by numbers, and condenses consecutive numbers into ranges. For example, the input [“osc1”, “osc2”, “osc3”, “osc5”] will be condensed to “osc1-3,5”.
- Parameters:
inputs (Sequence[str] | None) – A sequence of strings to condense. If None or empty, an empty string is returned.
- Returns:
A condensed string representation of the input sequence.
- Return type:
str