Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

string-indexes

fabiospampinato16.7kMIT2.0.1TypeScript support: included

Retrieves all indexes, in non-overlapping ranges, of a substring in a string.

string, index, indexes, all

readme

String Indexes

Retrieves all indexes, in non-overlapping ranges, of a substring in a string.

Install

npm install string-indexes

Usage

import getIndexes from 'string-indexes';

// Let's retrieve all the indexes for "xx"

getIndexes ( 'xxxx__xxxx__xxxxx', 'xx' ); // => [0, 2, 6, 8, 12, 14]

License

MIT © Fabio Spampinato