text-transformations
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

Text Transformations

A simple library for text transformations (capitalization, spaces removal, etc.)


NPM Version

Installation

npm install text-transformations

Usage

Using require

const TextTransformation = require('text-transformations')

Using import

import TextTransformations from "text-transformations"

Available Transformations

Capitalize each word of a string

console.log(TextTransformations.CapitalizeEach("hello world"));
// Hello World

Clear uncommon spaces (like multiple spaces between words / spaces at the end or start of the string)

console.log(TextTransformations.ClearSpaces("Hello   World "));
// Hello World

Replace all occurrences of an array of matches

console.log(TextTransformations.ReplaceAll("(889) (849)-(8495)", "", ["(", ")", "-", " "]));
// 8898498495

Package Sidebar

Install

npm i text-transformations

Weekly Downloads

3

Version

0.1.2

License

MIT

Unpacked Size

3.05 kB

Total Files

4

Last publish

Collaborators

  • caveman46