mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
8 lines
225 B
TypeScript
8 lines
225 B
TypeScript
export const capitalizeString = (str: string): string => {
|
|
const arr = str.split(" ");
|
|
|
|
for (var i = 0; i < arr.length; i++) {
|
|
arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);
|
|
}
|
|
return arr.join(" ");
|
|
};
|