2025-03-05 11:39:08 -08:00
|
|
|
/**
|
|
|
|
|
* Capitalizes the first letter of each word in a string.
|
|
|
|
|
*/
|
|
|
|
|
export function capitalizeSentence(string: string): string {
|
2025-03-05 11:39:23 -08:00
|
|
|
return string
|
|
|
|
|
.split(" ")
|
|
|
|
|
.map((word) => {
|
|
|
|
|
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
|
|
|
})
|
|
|
|
|
.join(" ");
|
2025-03-05 11:39:08 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Capitalizes the first letter of a string.
|
|
|
|
|
*/
|
|
|
|
|
export function capitalize(string: string): string {
|
|
|
|
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
|
|
|
}
|