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

  1. line*-String

    The line to count

  2. count{}Object

    Specify what you want to count outside of the normal characters of yourse. Here’s the list of available options:

Return

  1. -Number

    How many characters their is in the line

Example

import { countLineChars } from '@blackbyte/sugar/string';
 countLineChars('Hello <red>World</red>'); // 11

Settings

  1. htmlTagsfalseBoolean

    Specify if you want to count the html tags or not

  2. terminalSpecialCharsfalseBoolean

    Specify if you want to count the terminal specials chars like “\u001b[30m”, etc…

  3. newLineCharsfalseBoolean

    Specify if you want to count the new line special char “\n” or not

Todo

  • testsnormal