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 details)
File details
Details for the file findsubstring-0.1.tar.gz
.
File metadata
- Download URL: findsubstring-0.1.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 667a61d38a366c6d608e9dc346b15ca5725be46f4cae38b6e228306b38fa67e2 |
|
MD5 | aaff1c1c9ebe68baa60ba0af8b53c3fe |
|
BLAKE2b-256 | de1e1cd94babda5140863ec602cb867f0cf39b93c0c029dd4599d4b5ba873cab |