Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Add substrCount() to Stringable #2182

Open
pedzed opened this issue Apr 11, 2020 · 1 comment
Open

Add substrCount() to Stringable #2182

pedzed opened this issue Apr 11, 2020 · 1 comment

Comments

@pedzed
Copy link

pedzed commented Apr 11, 2020

The method substrCount is missing and my suggestion is to add it in.

Example

Str::of('abc abc')->substrCount('a');

Expected

2

Actual

Method Illuminate\Support\Stringable::substrCount does not exist.

Stringable::substr() exists and it would be nice to also have Stringable::substrCount().

Related: https://www.php.net/manual/en/function.substr-count.php

@crissto
Copy link

crissto commented Apr 15, 2020

Hey @pedzed!
Thanks for the suggestion. This was a nice little problem to be my first contribution to the laravel/framework.

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

No branches or pull requests

2 participants