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");
abbreviate("Lorem ipsum");
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 ");