uppercase-util
v1.0.2
Published
capitalize-first-letter-js is a JavaScript function designed to capitalize the first letter of each word in a given string.
Downloads
22
Readme
Sure, here's a simple README file for your open-source project:
# capitalize-first-letter-js
## Description
capitalize-first-letter-js is a lightweight JavaScript function designed to capitalize the first letter of each word in a given string.
## Installation
You can simply copy the `capitalizeFirstLetter` function into your JavaScript project.
## Usage
```javascript
// Import or define the capitalizeFirstLetter function
// Example usage:
let inputString = "hello world how are you";
let result = capitalizeFirstLetter(inputString);
console.log(result); // Output: "Hello World How Are You"
How it works
The capitalizeFirstLetter
function takes a string as input and capitalizes the first letter of each word in the string. It achieves this by using a regular expression to match the first character of each word and replacing it with its uppercase version.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Remember to include a `LICENSE` file in your project directory with the appropriate license text. You can choose any license that suits your project's needs, but for simplicity, I've mentioned the MIT License in the README.