Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

A JavaScript library converting a string, capitalizing first letter of each sentence and inserting a dot at the end if needed.

Notifications You must be signed in to change notification settings

oprogramador/to-sentence-case-with-dot

Repository files navigation

to-sentence-case-with-dot

MIT License Build Status

NPM status

A JavaScript library which, for each sentence, transforms the first letter to upper case and other letters to lower case.

It appends a dot at the end if not added before.

It recognizes dot ., question mark ? and exclamation mark ! as characters ending a sentence.

After the character ending a given sentence, there must be a space.

install

npm install --save to-sentence-case-with-dot or yarn add to-sentence-case-with-dot

usage

const toSentenceCaseWithDot = require('to-sentence-case-with-dot').default;

const input = 'loREm IPsum DOLOR sit ameT. consectetur! Adipiscing elit? sed DO eiusmod tempor incididunt';
const result = toSentenceCaseWithDot(input);
expect(result).to.equal('Lorem ipsum dolor sit amet. Consectetur! Adipiscing elit? Sed do eiusmod tempor incididunt.');

In order to see more details, see tests.

About

A JavaScript library converting a string, capitalizing first letter of each sentence and inserting a dot at the end if needed.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •