To convert camelCase string to Title Case (ES6)
const convertCamelToTitleCase = (camelCase) =>
camelCase
.replace(/([A-Z])/g, (match) => ` ${match}`)
.replace(/^./, (match) => match.toUpperCase())
//Example: convertCamelToTitleCase('todayILearned')
//Result: Today I Learned
Top comments (0)