list2str

sisl.utils.list2str(lst)[source]

Convert a list of elements into a string of ranges

Examples

>>> list2str([2, 4, 5, 6])
"2, 4-6"
>>> list2str([2, 4, 5, 6, 8, 9])
"2, 4-6, 8-9"