sundays/src/utils/strings.js

8 lines
194 B
JavaScript
Raw Normal View History

2026-06-05 14:31:12 -06:00
export const titleCase = (s) => {
if (!s) return "";
return s
.toLowerCase()
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
};