I want a string entered should be converted to sentence case in whatever case it is.
Like
hi all, this is derp. thank you all to answer my qu
On each line this script will print ..... Sunday Monday Tuesday Wednesday Thursday Friday Saturday.
let rg = /(^\w{1}|\.\s*\w{1})/gi;
const days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
for(let day of days) {
console.log(day.replace(rg, function(toReplace) {
return toReplace.toUpperCase();
}))