trimLines

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.string

This function take a string and trim each lines

Params

  1. string*-String

    The string to trim lines of

  2. settings{}Object

    An object settings. Here’s the object properties:

Return

  1. -String

    The processed string

Example

import { trimLines } from '@blackbyte/sugar/string';
trimLines(`my cool lines
     that have some lines to trim
and some not...`);
// my cool lines
// that have some lines to trim
// and some not...

Settings

  1. leftPadding0Number

    Specify a left padding to set. 1 padding represent 1 space character

  2. rightPadding0Number

    Specify a right padding to set.

  3. keepEmptyLinestrueBoolean

    Specify if you want to keep empty lines or not

Todo

  • testsnormal