drivetribe-string-formatters

1.1.2 • Public • Published

drivetribe-string-formatters

Collection of string formatter functions to change strings.

Install

Install the module directly from npm:

npm install drivetribe-string-formatters --save

Formatters

Abbreviate

Abbreviate by initials of first three words found in string, ie "Lorem ipsum dolor sit amet" -> "Lid".

abbreviate(quant: string): string

Example

import { abbreviate } from 'drivetribe-string-formatters';
 
abbreviate("Lorem ipsum dolor sit amet"); // "Lid"
abbreviate("Lorem ipsum"); // "Li"

Remove non alphanumeric

Remove non alphanumeric chararacters in string, ie '\/-12 3asd./,\][-=+_!@£$%^&*(±)?><~' -> "123asd".

removeNonAlphaNumeric(quant: string): string

Example

import { removeNonAlphaNumeric } from 'drivetribe-string-formatterss';
 
removeNonAlphaNumeric("-123asd "); // "123asd"

Dependents (0)

Package Sidebar

Install

npm i drivetribe-string-formatters

Weekly Downloads

1

Version

1.1.2

License

ISC

Last publish

Collaborators

  • popmotion