Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String.count() method to count occurrences of substring #27749

Closed
Mochnant opened this issue Apr 7, 2019 · 3 comments · Fixed by #25090
Closed

String.count() method to count occurrences of substring #27749

Mochnant opened this issue Apr 7, 2019 · 3 comments · Fixed by #25090

Comments

@Mochnant
Copy link

Mochnant commented Apr 7, 2019

I'd like to propose a str.count() method similar to the core Python version below.

str.count(sub[, start[, end]])
Return the number of non-overlapping occurrences of substring sub in the range [start, end]. Optional arguments start and end are interpreted as in slice notation.

Source: https://docs.python.org/3/library/stdtypes.html

@Chaosus
Copy link
Member

Chaosus commented Apr 7, 2019

#25090

@Chaosus Chaosus added this to the 3.2 milestone Apr 7, 2019
@akien-mga akien-mga changed the title [Feature Request] str.count() String.count() method to count occurrences of substring Apr 7, 2019
@Mochnant
Copy link
Author

Mochnant commented Apr 7, 2019

Thanks, @Chaosus! Sorry for missing that PR, glad to see it is already in progress.

@Chaosus
Copy link
Member

Chaosus commented Apr 7, 2019

Your welcome. No problem, it's a common mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants