Answers for "how to split string by list of indexes python"

0

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!']
Posted by: Guest on April-18-2021

Code answers related to "how to split string by list of indexes python"

Python Answers by Framework

Browse Popular Code Answers by Language