Saturday, October 15, 2022

Check case in string and return match

// check first letter UpperCase in match

((match) => {
if (match[0] === match[0].toUpperCase()) {
return `<mark>${text[0]
.toUpperCase()
.concat(text.slice(1, text.length))}</mark>`;
}
})();

//

No comments:

Post a Comment