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

Create kBXNqy.ts #1590

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions EFeSKC/kBXNqy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function capitalizeFirstLetter(inputString: string): string {
if (inputString.length === 0) {
return inputString; // Return the original string if it's empty
}

const firstLetter = inputString[0].toUpperCase();
const restOfString = inputString.slice(1);

return firstLetter + restOfString;
}

// Example usage:
const input = "hello world";
const capitalized = capitalizeFirstLetter(input);
console.log(capitalized); // Output: "Hello world"