Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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!']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #split #string #list #indexes #python
ADD COMMENT
Topic
Name
8+1 =