I have a string like
FIRST SENTENCE. SECOND SENTENCE.
I want to lowercase the string in that way to capitalize the first letter of each sentence.
For example:
string = string.toLowerCase().capitalize();
only the first sentence is capitalized.
I have the
String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() + this.slice(1); }
function
Does anyone know how to solve?