var text = 'a journey of a thousand miles begins with single step.'; var newText =text.replace(//b/w+/b/g, function(word) { return word.substring(0,1).toUpperCase( ) + word.substring(1); }); alert(newText);var text = 'a journey of a thousand miles begi 你的当前访问异常,请进行认证后继续阅读剩余内容。 提交