@pelevesque/find-char

0.1.2 • Public • Published

Build Status Coverage Status JavaScript Style Guide

find-char

Finds all the indices of a char in a string.

Node Repository

https://www.npmjs.com/package/@pelevesque/find-char

Installation

npm install @pelevesque/find-char

Tests

Standard Style & Unit Tests

npm test

Unit Tests & Coverage

npm run cover

Usage

find-char returns an array of all the indices of the char in the string.

If the char is not found, -1 is returned.

const findChar = require('@pelevesque/find-char')
const str = 'a little rabbit and an oxe'
const char = 'a'
const result = findChar(str, char)
// result === [0, 10, 16, 20]

Package Sidebar

Install

npm i @pelevesque/find-char

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

4.89 kB

Total Files

6

Last publish

Collaborators

  • pelevesque