📜  如何按索引列表拆分字符串python代码示例

📅  最后修改于: 2022-03-11 14:46:06.794000             🧑  作者: Mango

代码示例1
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!']