# String.isplit (iterator-based split for strings)

**URL:** <https://discuss.python.org/t/string-isplit-iterator-based-split-for-strings/7533>\
**Category:** Ideas\
**Created:** [March 5, 2021, 8:12pm UTC](https://discuss.python.org/t/string-isplit-iterator-based-split-for-strings/7533 "2021-03-05T20:12:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![brettcannon](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/brettcannon/32/34895_2.png) [@brettcannon](https://discuss.python.org/u/brettcannon)\
**Post date:** [March 5, 2021, 8:31pm UTC](https://discuss.python.org/t/string-isplit-iterator-based-split-for-strings/7533/2 "2021-03-05T20:31:16Z")

</div>

What’s the exact API you are proposing? Is it literally just to have lazy splitting, or did you want to incorporate filtering as well?

And you can already avoid splitting over the whole string by iterating and slicing on the string yourself.

```auto
start = 0
for index, char in enumerate(str):
    if char == " ":
        substr = str[start:index]
        if match := operation(substr):
            break
        else:
            start = index + 1

```

---

_[View the full topic](https://discuss.python.org/t/string-isplit-iterator-based-split-for-strings/7533)._
