Skip to content

codetheweb/substr-occurrence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Substr Occurrence

forthebadge Build Status

A small, extremely lightweight library that counts the number of occurrences of a substring or single character in a larger string. Created because string-occurrence was too bloated and slow.

Installation

npm install codetheweb/substr-occurrence

Usage

var occurrence = require('substr-occurrence');

console.log(occurrence('o', 'foo bar');

Output should be 2.

Tests

npm test

About

A small library that counts the number of occurrences of a substring

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published