@snickbit/upwords
v2.0.41
Published
Helper function to convert a string to title case, attempting to preserve acronyms and special case words.
Downloads
47
Readme
@snickbit/upwords
Helper function to convert a string to title case, attempting to preserve acronyms and special case words like "of" and "iPhone".
Installation
yarn add @snickbit/upwords
npm add @snickbit/upwords
Basic Usage
import upwords from '@snickbit/upwords'
upwords('hello') // 'Hello'
upwords('hello world') // 'Hello World'
upwords('iphone') // 'iPhone'
upwords('usd') // 'USD'
upwords('d&d') // 'D&D'
upwords('created_at') // 'Created at'
upwords('created__at') // 'Created at'
upwords('i-like-to--play--d&d-in-3d') // 'I Like to Play D&D in 3D'
License
Copyright (c) 2022 - Nicholas Lowe aka Snickbit