find all occurrences of a substring within a string, and return indexes
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
History.md
Makefile
Readme.md
component.json
example.html
index.js

Readme.md

string-occurrence

find all occurrences of a substring within a string, and return indexes

Installation

Install with component(1):

$ component install bmcmahen/string-occurrence

API

var occurrence = require('string-occurrence');
var results = occurrence('this is a string that repeats this', 'this');
// results.length == 2

License

MIT