how to split string by list of indexes python code example
Example: how to split string by list of indexes python
In [42]: s = "Hello there!"
In [43]: [s[v1:v2] for v1, v2 in zip([0]+l, l+[None])]
Out[43]: ['He', 'llo ', 'the', 're!']
In [42]: s = "Hello there!"
In [43]: [s[v1:v2] for v1, v2 in zip([0]+l, l+[None])]
Out[43]: ['He', 'llo ', 'the', 're!']