Back to utils
UtilsuppercaseFirstLetter
Converts the first letter of a string to uppercase while keeping the rest unchanged.
| Category: | Strings |
Usage
const input = 'helloWorld'
const result = uppercaseFirstLetter(input)
console.log(result)
// Output: "HelloWorld"
Type definition
/**
* Converts the first letter of a string to uppercase while keeping the rest unchanged.
*
* @param str - The input string.
* @returns The transformed string with the first letter in uppercase.
*/
export declare const uppercaseFirstLetter: (str: string) => string