Now I have this regex:
tSzoveg = tSzoveg.replace(/\b[A-Z]{2,}\b/,'');
It is almost that I want. I want to convert this: THIS IS MINE, NOT YOURS.
to this: This is mine, not yours.
How can I convert it to a normal sentence?
Now I have this regex:
tSzoveg = tSzoveg.replace(/\b[A-Z]{2,}\b/,'');
It is almost that I want. I want to convert this: THIS IS MINE, NOT YOURS.
to this: This is mine, not yours.
How can I convert it to a normal sentence?
function capitalize(string)
{
return string.toUpperCase().charAt(0) + string.toLowerCase().slice(1);
}
I would use toLowerCase()
and then modify the first letter:
var str = "THIS IS MINE, NOT YOURS."
str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();