Python3 module to find a substring on a string.
Project description
findsubstring
Python3 module to find a substring on a string.
Based on Karl Knechtel's answer on Stack Overflow: https://stackoverflow.com/questions/4664850/find-all-occurrences-of-a-substring-in-python
Installation
Install with pip
pip3 install -U findsubstring
Usage
In [1]: import findsubstring
In [2]: list(
findsubstring.find_all(
str_="spam spam spam spam",
substring="spam"
)
)
Out[2]: [0, 5, 10, 15]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
findsubstring-0.1.tar.gz
(1.8 kB
view hashes)