Ionic Guru
Pages
(Move to ...)
Home
Blog
Contact
About Me
▼
Thursday, April 21, 2016
Capitalize in Javascript
You can
Capitalise
a string by core
Javascript
. I've write a function for this :
String.prototype.
capitalize
=
function
() {
return
this.replace(
/(?:^|\s)\S/g
,
function
(a) {
return
a.toUpperCase()
;
})
;
}
;
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment