在JavaScript / Jquery中使用首字母大写
这个问题在这里已经有了答案:
  你不需要这个jQuery。  您可以使用Javascript string和array函数。 
.  ,分开不同的句子 . var str = 'this is a test. this is one more test. and this also new test.';
var newStr = str.split('.').map(function(el) {
  el = el.trim();
  return el.substr(0, 1).toUpperCase() + el.substr(1);
}).join('. ');
alert(newStr.trim());上一篇: Capitalize the first letter of sentense in JavaScript/Jquery
下一篇: How can I make the first letter of a variable always capital?
