A very lightweight JavaScript library for taking out extra spaces in a string, can make first letter of a string, first letter of each words in a string or all letters in a string to uppercase.
npm i zeba
const zeba = require('zeba');
let input = '
this is the input.';
input = zeba(input).fullTrim().capitilize().value();
console.log(input);
- Use
value()
to get the value.
This is the input.
-
capitilize()
- Example: this is the text -> This is the text.
-
upper()
- from: this is the text -> This Is The Text.
-
allupper()
- from: this is the text -> THIS IS THE TEXT.
-
fullTrim()
- fully trims the string from front, back and in betweens.
let text = '
this is the text.';
text = zeba(text).fullTrim().value();
console.log(text);
- outputs:
this is the text.