Gravitywell String-manipulation
Library of utility functions to manipulate strings
Table of Contents
Usage
import { <LIB_NAME_HERE> } from "@gravitywelluk/string-manipulation";
punctuate
Checks if the given string has the request punctuation mark and adds it to the string if it does not.
import { punctuate, PunctuationMark } from "@gravitywelluk/string-manipulation";
punctuate("The quick brown fox jumps over the lazy dog", PunctuationMark.FULL_STOP);
sentenceCase
Converts a strings 1st letter to uppercase
import { sentenceCase } from "@gravitywelluk/string-manipulation";
sentenceCase("the fox JUMPED over Brian's lazy dog");
slurlgify
Converts the given slug into a slugified URL
import { slurlgify } from "@gravitywelluk/string-manipulation";
slurlgify("the fox JUMPED over Brian's lazy dog & cat + mouse");
titleCase
Converts the given sentence string into title case
import { titleCase } from "@gravitywelluk/string-manipulation";
titleCase("the fox JUMPED over brian's lazy dog");