lhl 6ff0e96ad3 8-4-1 | há 1 ano atrás | |
---|---|---|
.. | ||
index.js | há 1 ano atrás | |
license | há 1 ano atrás | |
package.json | há 1 ano atrás | |
readme.md | há 1 ano atrás |
Count the longest repeating streak of a character.
npm:
npm install longest-streak
var longestStreak = require('longest-streak')
longestStreak('` foo `` bar `', '`') // => 2
longestStreak(value, character)
Get the count of the longest repeating streak of character
in value
.
value
(string
) — Content, coerced to string.character
(string
) — Single character to look for.number
— Number of characters at the place where character
occurs in
its longest streak in value
.
Error
— when character
is not a single character string.