letter-count

v2.1.1arrow_drop_down
v2.1.1
v2.1.0
v2.0.9
v2.0.8
v2.0.6
v2.0.5
v2.0.1
v1.1.1
v1.1.0
v1.0.8
v1.0.5
v1.0.4
v1.0.3
STATUS
Passing
DOWNLOADS
1,917
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
535 B
letter count function - count number of letter in a string
1 contributor
Install letter-count as a package?
Copied
npm i @bit/joshk.jotils.letter-count
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
letterCount (
text:string,
letter:string,
ignorecasesensitive:boolean
) : number

count number of letter in a string

Examples
import { letterCount } from '@bit/joshk.jotils.letter-count'
export default letterCount('abcd', 'a') // => 1
import { letterCount } from '@bit/joshk.jotils.letter-count'
export default letterCount('abcd', 'A', false) // => 1
Arguments
text: string

value

letter: string

value to count

ignorecasesensitive: boolean

ignore case sensitive if true

Returns
number

number

Test Summary

letterCount return the number of time that character appears in a string

Pass

letterCount return the number of time that character appears in a string with no casesensitive

Pass

letterCount return the number of time that character appears in a string with casesensitive

Pass
Help and resources