Count the number of occurrences in string

Benchmark created by vsync on


Test runner

Ready to run.

Testing in
TestOps/sec
regular expression
"124682895579215".match(/2/g).length;
ready
split
"124682895579215".split("2").length - 1
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.