counting-str
v1.0.6
Published
Module for counting strings, characters length
Downloads
313
Maintainers
Readme
Counting STR (Counting String)
Working Status
:construction: Under Construction :construction:
Installation
npm i counting-str
Usage
Count Words
const { countWords } = require('counting-str');
countWords("Hello World"); // return 2
Count Characters
const { countCharacters } = require('counting-str');
countCharacters("Hello World"); // return 11
Count Characters without including spaces
countCharacters("Hello World", { withSpaces: false }); // return 10
Count Spaces
const { countSpaces } = require('counting-str');
countSpaces("Hello World"); //return 1
Count Vowels
const { countVowels } = require('counting-str');
countVowels("Hello World"); // return 3
Count an occurence of a Character/String in another String
const { countOccurences } = require('counting-str');
countOccurences("Hello World", "l"); // return 3
|Name | Arguments | Info | |---------------|-------------------------------|---------------------------------------------------------| |countWords | String | returns # of words in a string | |countSpaces | String | returns # of spaces in a string | |countVowels | String | returns # of vowels in a string |countCharacters| Object { withSpaces: boolean }| withSpaces: true returns # of characters included space | |countOccurences| (String, String) | returns occurences count in a string |
:handshake: Feel free to open a pull request to add more features.
- make clone
- create a pull request
- feel free to open an issue
- OPEN FOR BEGINNERS AND NEW CONTRIBUTORS