shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
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
- string*-String
The string to trim lines of
- settings{}Object
An object settings. Here’s the object properties:
Return
- -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
- leftPadding0Number
Specify a left padding to set. 1 padding represent 1 space character
- rightPadding0Number
Specify a right padding to set.
- keepEmptyLinestrueBoolean
Specify if you want to keep empty lines or not
Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space