🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

ex-indexof

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ex-indexof

Extended `indexOf` for specific occurrence time

1.0.0
latest
Source
npm
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

Extended-IndexOf

Extended indexOf for specific occurrence time.

var exIndexOf = require('ex-indexof');

exIndexOf('hello, world', 'o'); // => 4
exIndexOf('hello, world', 'o', 1); // => 8
exIndexOf('hello, world', 'o', 2); // => -1

// reverse direction
exIndexOf('hello, world', 'o', -1); // => 8
exIndexOf('hello, world', 'o', -2); // => 4
exIndexOf('hello, world', 'o', -3); // => -1

// substring
exIndexOf('too simple, too young, sometime naive', 'too', -2); // => 0

Keywords

indexof

FAQs

Package last updated on 16 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts