Okay, after some reading on RegEx and some trial and error, I have (stumbled) upon the solution to my problem.
I realized that most of the stuff in the script I adapted was irrelevant junk. So I stepped back and took the problem piecemeal.
First, I decided to render all the text in lowercase:
var capText = $('#finaltext').val();
capText=capText.toLowerCase();
then, I needed to use .replace to find all instances of "dash+space+any letter":
.replace(/- ./g,
This will find the one letter after the dash in all instances, then I combine with a function to make uppercase:
.replace(/- ./g, function(c){return c.toUpperCase();});
final code is:
$('#normalize').click(function capitalizeSentences() {
var capText = $('#finaltext').val();
capText=capText.toLowerCase();
capText2 = capText.replace(/- ./g,function(c){ return c.toUpperCase(); });
$("#finaltext").val(capText2);
});
See here - http://jsfiddle.net/fDy6K/