您最喜爱的技术社区。浏览所有集合
现在可在团队堆栈溢出上使用!你工作的AI功能:搜索、IDE和聊天。
提出问题,找到答案,并与团队堆栈溢出协作。探索团队
找到集中、可信的内容,围绕您最常用的技术进行协作。
团队
工作问答
在一个结构化且易于搜索的位置内连接和共享知识。
尽早访问并查看新功能的预览。
一个小小的改进——标题中的每个单词。
String.prototype.toTitleCase=函数(){return this.replace(/\b(\w+)/g,函数(m,p){return p[0].toUpperCase()+p.substr(1).toLowerCase(()});}var s='你好, wOrLD';“哦!”;console.log(s.toTitleCase());//你好,世界!
String.prototype.toTitleCase=函数(){return this.replace(/\b(\w+)/g,函数(m,p){return p[0].toUpperCase()+p.substr(1).toLowerCase(()});}var s='你好wOrLD';console.log(s.toTitleCase());//你好,世界
String.prototype.toTitleCase=函数(){return this.replace(/\b(\w+)/g,函数(m,p){return p[0].toUpperCase()+p.substr(1).toLowerCase(()});}var s=“你好”, 哇!';console.log(s.toTitleCase());//你好,世界!
String.prototype.toTitleCase=函数(){ return this.replace(/\b(\w+)/g,函数(m,p){return p[0].toUpperCase()+p.substr(1).toLowerCase(()});}var s='你好wOrLD(沃尔德)'wOrLD';console.log(s.toTitleCase());//你好,世界
String.prototype.toTitleCase=函数(){return this.replace(/\b(\w+)/g,函数(m,p){return p[0].toUpperCase()+p.substr(1).toLowerCase(()})}var s='你好wOrLD(沃尔德)'console.log(s.toTitleCase())//你好世界
String.prototype.toTitleCase=函数(){ return this.replace(/\b(\w+)/g,函数(m,p){return p[0].toUpperCase()+p.substr(1).toLowerCase(()});}var s='你好wOrLD';console.log(s.toTitleCase());//你好,世界
字符串原型。标题酶到TitleCase=函数(){ return this.replace(/\b(\w+)/g,函数(m,p){return p[0].toUpperCase()+p.substr(1).toLowerCase(()}) } var s='helLLo wOrLD' console.log(s。标题酶到TitleCase()//你好世界
字符串原型。标题酶=函数(){ return this.replace(/\b(\w+)/g,函数(m,p){return p[0].toUpperCase()+p.substr(1).toLowerCase(()}) } var s='helLLo wOrLD' 控制台日志。标题酶()//你好世界
字符串原型。到TitleCase=函数(){return this.replace(/\b(\w+)/g,函数(m,p){return p[0].toUpperCase()+p.substr(1).toLowerCase(()})}var s='helLLo wOrLD'console.log(s。至标题案例()//你好世界