string-indexes

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

MIT 3 个版本
安装
npm install string-indexes
yarn add string-indexes
pnpm add string-indexes
bun add string-indexes
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

版本列表
2.0.1 2025-01-19
2.0.0 2022-04-06
1.0.0 2020-01-29