shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
countLineChars
Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.string
Count how many characters their is in the passed line. This function will exclude the characters like the html tags like <red>, etc…
Params
- line*-String
The line to count
- count{}Object
Specify what you want to count outside of the normal characters of yourse. Here’s the list of available options:
Return
- -Number
How many characters their is in the line
Example
import { countLineChars } from '@blackbyte/sugar/string';
countLineChars('Hello <red>World</red>'); // 11Settings
- htmlTagsfalseBoolean
Specify if you want to count the html tags or not
- terminalSpecialCharsfalseBoolean
Specify if you want to count the terminal specials chars like “\u001b[30m”, etc…
- newLineCharsfalseBoolean
Specify if you want to count the new line special char “\n” or not
Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space