capitalized

Returns true if a string’s first letter is uppercase.

Usage no npm install needed!

<script type="module">
  import capitalized from 'https://cdn.skypack.dev/capitalized';
</script>

README

capitalized

Returns true if a string’s first letter is uppercase.

Installation

To install using Node.js:

npm i capitalized

API

The module exports a single function.

Parameter

str (string)

Return Values

  • true if str is capitalized
  • false otherwise

Example

const capitalized = require('capitalized')

capitalized('not capitalized') // false
capitalized('Capitalized') // true
capitalized('UPPERCASE') // true