String.prototype.firstUpperCase = function(){
return this.replace(/\b(\w)(\w*)/g, function($0, $1, $2) {
return $1.toUpperCase() + $2.toLowerCase();
});
}
Created
April 16, 2016 14:22
-
-
Save lx7575000/f5790cfea4f66efa7533d0678af650c1 to your computer and use it in GitHub Desktop.
返回首字母大写
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment