No description
Find a file
2024-08-14 14:10:56 +08:00
.gitignore Initial commit 2024-07-28 03:57:42 +08:00
index.js feat: add logic 2024-07-28 04:18:03 +08:00
package-lock.json Initial commit 2024-07-28 03:57:42 +08:00
package.json Initial commit 2024-07-28 03:57:42 +08:00
README.md Update README.md 2024-08-14 14:10:56 +08:00

Check If It's a Title String

Question

Sloth Bytes | 2024-07-23

Check If It's a Title String
Check if a string is formatted as a title. A title string is when every word of the string start with a upper case letter.

Examples
checkTitle("A Mind Boggling Achievement") ➞ true

checkTitle("A Simple C++ Program!") ➞ true

checkTitle("Water is transparent") ➞ false

Description

This utility checks if a given string is a title string. A title string is a string that has the first letter of each word capitalized and the rest of the letters in lowercase.

Table of Contents

Installation

To use the code in this repository, you need to have Node.js installed on your machine. Clone the repository to your local system using the following command:

git clone https://github.com/afiqzudinhadi/check-string-title-capitalize.git

Install the required dependencies by running the following command:

npm install

Usage

  1. Navigate to the repository's root directory.
  2. Open terminal or command prompt.
  3. Run the following command to execute the code:
npm run index
  1. Follow the on-screen instructions to input the string and check if it is a title string.